Jump to content

PickUp ..Help


^Dev-PoinT^

Recommended Posts

Posted

Hi all i need if Player Take The Health PickUp outputChatBox Msg To Him is it right?

function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) 
       local  x, y, z = getElementPosition ( source ) 
       local  health = createPickup ( x, y, z, 0, 40) 
       addEventHandler("onPickupHit", health, givePlayerHealth) 
    end 
    addEventHandler ( "onPlayerWasted", getRootElement(), createDeathPickup ) 
      
    function givePlayerHealth(thePlayer) 
         setElementHealth(thePlayer,tonumber(getElementHealth(thePlayer))+tonumber(getPickupAmount(source))) 
        destroyElement(source) 
    end 
if getPickupType ( source ) == 0 then  
    amount = getPickupAmount ( source ) 
    outputChatBox ( "You picked up " .. amount .. " health", thePlayer) 
  

Posted
function createDeathPickup(totalammo, killer, killerweapon, bodypart) 
    local x, y, z = getElementPosition(source) 
    health = createPickup(x, y, z, 0, 40) 
end 
addEventHandler("onPlayerWasted", getRootElement(), createDeathPickup) 
  
function givePlayerHealth(player) 
    if getPickupType(source) == 0 then 
        local amount = getPickupAmount(source) 
        setElementHealth(player, tonumber(getElementHealth(player)) + tonumber(getPickupAmount(source))) 
        destroyElement(source) 
        outputChatBox("You picked up " .. amount .. " health", player) 
    end 
end 
addEventHandler("onPickupHit", health, givePlayerHealth) 

Posted

stop fixing scripts for someone who doesnt want to learn.

he just dump the random shit on you and you people fix it for him. this guy will never learn anything.

Posted
stop fixing scripts for someone who doesnt want to learn.

he just dump the random :~ on you and you people fix it for him. this guy will never learn anything.

He is right. You should not fix his script but help him how to fix his script.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...