OrbTanT Posted July 21, 2014 Posted July 21, 2014 Good I am creating a system to buy properties, and earn a certain amount every 5 minutes, Is not giving right to receive the profit, I have a basis for to do, More is not giving right to connect the script. local pickup = createPickup(2181.8864746094,1115.2287597656,12.34375,3,1273,0) addEventHandler("onPickupHit",pickup,function(player) outputChatBox("Propriedades: Digite /comprar",player) end) addCommandHandler("comprar",function(player) if isElementWithinColShape(player,getElementColShape(pickup)) then takePlayerMoney(player,200000) end end) lucre setTimer(function(theplayer) givePlayerMoney(source,2500) end,300000,1)
OrbTanT Posted July 22, 2014 Author Posted July 22, 2014 i tried to work in this way the script, more displays the following error WARNING: propriedades\teste.lua:9: Bad argument @ 'givePlayerMoney' script local pickup = createPickup(2181.8864746094,1115.2287597656,12.34375,3,1273,0) addEventHandler("onPickupHit",pickup,function(player) outputChatBox("Propriedades: Digite /comprar",player) end) addCommandHandler("comprar",function(player) if isElementWithinColShape(player,getElementColShape(pickup)) then takePlayerMoney(player,50) setTimer(function(theplayer) givePlayerMoney(source,2500) end, 5000, 0) end end)
OrbTanT Posted July 22, 2014 Author Posted July 22, 2014 Continues with bad argument in @givePlayerMoney and does not return the profit.
toxicsmoke11 Posted July 22, 2014 Posted July 22, 2014 Then try to replace theplayer at line 8 and 9 with player
OrbTanT Posted July 22, 2014 Author Posted July 22, 2014 Nothing happens, yet there is still the error and does not gain the profit
Max+ Posted July 22, 2014 Posted July 22, 2014 Continues with bad argument in @givePlayerMoney and does not return the profit. ---ServerSide local pickup = createPickup(2181.8864746094,1115.2287597656,12.34375,3,1273,0) timers = {} function Hit ( player ) outputChatBox ( "Propriedades: Digite /comprar", player ) takePlayerMoney ( player, 50 ) timers [player] = setTimer ( function ( ) givePlayerMoney ( player, 2500 ) end, 5000, 0 ) end addEventHandler( 'onPickupHit' ,pickup, Hit )
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