Im trying to create a pickup near the player when he types /givemoney {ammount} , i made the script but it does not work, i can t find bugs ..
function givemoney(thePlayer, command, amount)
local givingplayer = getPlayerFromName ( thePlayer )
local x,y,z = getElementPosition(thePlayer)
local x = x + 5
local gpickup = createPickup(x,y,z,1212)
takePlayerMoney (thePlayer, math.abs(tonumber(amount)))
end
addCommandHandler ("givemoney", givemoney)
function takemoney ( thePlayer )
givePlayerMoney(thePlayer, math.abs(tonumber(amount)))
destroyElement(gpickup)
end
addEventHandler ( "onPickupUse", gpickup, takemoney )