OrbTanT Posted July 21, 2014 Share 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) Link to comment
OrbTanT Posted July 22, 2014 Author Share 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) Link to comment
toxicsmoke11 Posted July 22, 2014 Share Posted July 22, 2014 At line 9 change source to theplayer Link to comment
OrbTanT Posted July 22, 2014 Author Share Posted July 22, 2014 Continues with bad argument in @givePlayerMoney and does not return the profit. Link to comment
toxicsmoke11 Posted July 22, 2014 Share Posted July 22, 2014 Then try to replace theplayer at line 8 and 9 with player Link to comment
OrbTanT Posted July 22, 2014 Author Share Posted July 22, 2014 Nothing happens, yet there is still the error and does not gain the profit Link to comment
Max+ Posted July 22, 2014 Share 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 ) Link to comment
OrbTanT Posted July 22, 2014 Author Share Posted July 22, 2014 Is working now thanks for the help Link to comment
Max+ Posted July 23, 2014 Share Posted July 23, 2014 Is working now thanks for the help You'r welcome 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