HUNGRY:3 Posted July 25, 2015 Share Posted July 25, 2015 hello i want the output to output for the player who click the button [CLIENT SIDE] but it output for everybody it works in server side if we put thePlayer or... in client side it won't work. lp = getLocalPlayer() function buy15() player_money = getPlayerMoney(lp) if source == GUNPANEL1.button[15] then if ( player_money >= 100000) then setElementData(lp,"lvl1",false) setElementData(lp,"lvl2",false) setElementData(lp,"lvl3",false) setElementData(lp,"lvl4",false) setElementData(lp,"lvl5",false) setElementData(lp,"lvl6",false) setElementData(lp,"lvl7",false) setElementData(lp,"lvl8",false) setElementData(lp,"lvl9",false) setElementData(lp,"lvl10",false) setElementData(lp,"lvl11",false) setElementData(lp,"lvl12",false) setElementData(lp,"lvl13",false) setElementData(lp,"lvl14",false) setElementData(lp,"lvl15",true) outputChatBox("WEAPON USED",255,0,0) guiSetText(GUNPANEL1.edit[1], "ROCKET LAUCHER") end end end addEventHandler("onClientGUIClick", root, buy15) Link to comment
SpecT Posted July 25, 2015 Share Posted July 25, 2015 Any error when you start it as client-side ? Link to comment
LaCosTa Posted July 25, 2015 Share Posted July 25, 2015 Maybe when you tried the script you were without money ?? an please state the errors from debugscript Link to comment
lolman Posted July 25, 2015 Share Posted July 25, 2015 If nothing helps, then just make a function in server side and then do triggerServerEvent, simple as that... Link to comment
Mega9 Posted July 26, 2015 Share Posted July 26, 2015 Does this work for you? local lp = getLocalPlayer() function buy15() if lp ~= localPlayer then return end local player_money = getPlayerMoney(lp) if source == GUNPANEL1.button[15] then if ( player_money >= 100000) then setElementData(lp,"lvl1",false) setElementData(lp,"lvl2",false) setElementData(lp,"lvl3",false) setElementData(lp,"lvl4",false) setElementData(lp,"lvl5",false) setElementData(lp,"lvl6",false) setElementData(lp,"lvl7",false) setElementData(lp,"lvl8",false) setElementData(lp,"lvl9",false) setElementData(lp,"lvl10",false) setElementData(lp,"lvl11",false) setElementData(lp,"lvl12",false) setElementData(lp,"lvl13",false) setElementData(lp,"lvl14",false) setElementData(lp,"lvl15",true) outputChatBox("WEAPON USED",255,0,0) guiSetText(GUNPANEL1.edit[1], "ROCKET LAUCHER") end end end addEventHandler("onClientGUIClick", root, buy15) 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