Bean666 Posted January 26, 2015 Share Posted January 26, 2015 hi guys, i want to fix a problem but i cant. because im bad with these functions , alright when i click the button , button disappears and shows a new one i added money restrictions in server.lua but when i click the button i dont have money . it says i dont have money yes. but it shows the another button . i dont know how to fix this. but ik ill use IF Functions i tried but it didnt work. help please. is there anyway with "if" functions to help with this. Code: addEventHandler("onClientGUIClick",GUIEditor.button[3],function() if ( source == GUIEditor.button[3]) then guiSetVisible(GUIEditor.button[3], false) guiSetVisible(GUIEditor.button[9], true) triggerServerEvent("shotgunstd",getLocalPlayer()) end end ) Link to comment
TAPL Posted January 26, 2015 Share Posted January 26, 2015 Use getPlayerMoney before you trigger. Link to comment
Bean666 Posted January 26, 2015 Author Share Posted January 26, 2015 any problems with this? please help i tried this but it didnt work. addEventHandler("onClientGUIClick",GUIEditor.button[1],function() if ( source == GUIEditor.button[1]) then getPlayerMoney(source) if (money > 2000) then guiSetVisible(GUIEditor.button[7], true) guiSetVisible(GUIEditor.button[1], false) triggerServerEvent("m4std",getLocalPlayer()) end end ) Link to comment
Malak Posted January 26, 2015 Share Posted January 26, 2015 any problems with this? please help i tried this but it didnt work. addEventHandler("onClientGUIClick",GUIEditor.button[1],function() if ( source == GUIEditor.button[1]) then getPlayerMoney(source) if (money > 2000) then guiSetVisible(GUIEditor.button[7], true) guiSetVisible(GUIEditor.button[1], false) triggerServerEvent("m4std",getLocalPlayer()) end end ) local money = getPlayerMoney(source) Link to comment
Bean666 Posted January 26, 2015 Author Share Posted January 26, 2015 this one didnt work. addEventHandler("onClientGUIClick",GUIEditor.button[1],function() if ( source == GUIEditor.button[1]) then local money = getPlayerMoney(source) if (money > 2000) then guiSetVisible(GUIEditor.button[7], true) guiSetVisible(GUIEditor.button[1], false) triggerServerEvent("m4std",getLocalPlayer()) end end ) Link to comment
TAPL Posted January 26, 2015 Share Posted January 26, 2015 addEventHandler("onClientGUIClick", GUIEditor.button[1], function() if source == GUIEditor.button[1] then if getPlayerMoney() >= 2000 then guiSetVisible(GUIEditor.button[7], true) guiSetVisible(GUIEditor.button[1], false) triggerServerEvent("m4std", localPlayer) end end end, false) 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