ArcAngeL Posted March 15, 2019 Share Posted March 15, 2019 Hi guys this codes giving money pickup after the ped kill.but ı need make 5 money pickup.how can ı create pickups table ? ı tried but didnt work.someone help me ? thanks function money (theKiller) if (source == nemesiR) then x,y,z = getElementPosition ( nemesiR ) ---get Element position(zombie that dead)position money = createPickup ( x + 1,y,z, 3, 1212,0 ) if money then function GivePlayerMoney (theKiller) givePlayerMoney ( theKiller, 5000 ) destroyElement ( source ) end addEventHandler ( "onPickupHit", money, GivePlayerMoney ) end end return end addEvent( "onBotWasted",true ) addEventHandler ("onBotWasted",getRootElement(),money) Link to comment
Moderators Patrick Posted March 15, 2019 Moderators Share Posted March 15, 2019 -- SERVER SIDE addEvent("onBotWasted",true ) addEventHandler("onBotWasted", root, function() local x, y, z = getElementPosition(source) -- dead zombie's pos for i = 1, 5 do local money = createPickup(x+math.random(-2,2), y+math.random(-2,2), z, 3, 1212, 0) -- place to near random pos addEventHandler("onPickupHit", money, function(player) givePlayerMoney(player, 5000) destroyElement(source) end) end end) 1 Link to comment
ArcAngeL Posted March 15, 2019 Author Share Posted March 15, 2019 thanks man you always helping me thanks a lot 1 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