E-mail Posted September 14, 2011 Share Posted September 14, 2011 Hi i have Made a Health Pickup how to add if player take the pickup PlayerName... Have Take a Health! my code outputChatBox("Health_Pickup|By[xiGooglex]"),255,255,0 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 Link to comment
Castillo Posted September 14, 2011 Share Posted September 14, 2011 (edited) outputChatBox("Health_Pickup|By[xiGooglex]",255,255,0) 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) outputChatBox(tostring(getPlayerName(thePlayer)) .." has picked up health.",getRootElement(),0,255,0) setElementHealth(thePlayer,tonumber(getElementHealth(thePlayer))+tonumber(getPickupAmount(source))) destroyElement(source) end Edited September 14, 2011 by Guest Link to comment
Twisted Posted September 14, 2011 Share Posted September 14, 2011 Missing a ) at the first line at the end Link to comment
TAPL Posted September 14, 2011 Share Posted September 14, 2011 should be outputChatBox("Health_Pickup|By[xiGooglex]",root,255,255,0) Link to comment
HoLsTeN Posted September 15, 2011 Share Posted September 15, 2011 you make the code ? 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 i think you want to make like bssol and TAPL script Link to comment
TAPL Posted September 15, 2011 Share Posted September 15, 2011 This explains why he don't know how to add outputChatBox to show player name that taking the Pickup Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now