manve1 Posted August 5, 2012 Share Posted August 5, 2012 When i made my script ( from help of community ) i cant buy things.. and it has to be shop panel.. please have a look and tell me whats wrong: CLIENT: function BuyWeapon1 () if(source == button1) then triggerServerEvent("onClientBuyWeapon", localPlayer, "weapon_colt") end end SERVER: if(weapon_name == "weapon_colt") then if(player_money >= tonumber(price_colt)) then giveWeapon(source, 22, 1) takePlayerMoney(source, tonumber(price_colt)) outputChatBox("You bought a colt.", source, 0, 255, 0) else outputChatBox("You do not have enough money to buy a colt.", source, 255, 0, 0) end Link to comment
codeluaeveryday Posted August 6, 2012 Share Posted August 6, 2012 Please post your full function including the event. Make sure you have added the event ( addEvent () ) Link to comment
ernst Posted August 6, 2012 Share Posted August 6, 2012 There is no evenhandler added to the client script. if(player_money >= tonumber(price_colt)) then Where is price_colt and player_money defined? Link to comment
manve1 Posted August 6, 2012 Author Share Posted August 6, 2012 here is price_colt local price_colt = "150" here is player_money player_money = getPlayerMoney(source) 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