Jump to content

Money pickups after the ped kill


ArcAngeL

Recommended Posts

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
-- 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)

 

  • Thanks 1
Link to comment

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...