Chilco Posted May 22, 2010 Share Posted May 22, 2010 Hey all, I made a button for buying repair: function ButtonRepair() local Moneyplayer = getElementData(getLocalPlayer(), "Money") if (Moneyplayer > 3500 ) then local vehicle = getPedOccupiedVehicle(getLocalPlayer()) fixVehicle(vehicle) setElementData(getLocalPlayer(),"Money",tostring(moneyplayer-3500)) else outputChatBox( "You don't have enough money ($3500) to buy repair!", getLocalPlayer(), 0, 150, 255 ); end end addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], ButtonRepair, false ) But it isn't working, can anyone help me? Thanks, -Chilco Link to comment
Chilco Posted May 22, 2010 Author Share Posted May 22, 2010 Anyone that knows how to fix it? Link to comment
Dark Dragon Posted May 22, 2010 Share Posted May 22, 2010 give people some time to see your problems and help. do you create the button you assign the event to anywhere? try tonumber(Moneyplayer) in line 3 and 6 (you even force the setElementData to save it as a string) plus variables are case sensitive(line 6). if this works you should read this page to be able to solve future problems by yourself: https://wiki.multitheftauto.com/wiki/Debugging client side you need no player parameter in outputChatBox 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