Chris!i! Posted February 17, 2016 Posted February 17, 2016 timer = {} function cancelShots() guiSetProperty( GUIEditor.button[1], "Disabled", "False" ) else guiSetProperty( GUIEditor.button[1], "Disabled", "True" ) end addEventHandler("onClientGUIClick", GUIEditor.button[1], localPlayer, function() setElementData(localPlayer, "anti.repeater", true); if ( getElementData(localPlayer, "anti.repeater") == true ) then timer[source] = setTimer( function() guiSetProperty( GUIEditor.button[1], "Disabled", "False" ) setElementData(localPlayer, "anti.repeater", false) removeEventHandler("onClientGUIClick", GUIEditor.button[1], cancelShots) end, 10000, 1 ) addEventHandler("onClientGUIClick", GUIEditor.button[1], cancelShots) end end Client Sided. I'm setting an no spam function for a button, it says end expected to close function at line 1, the function cancelShots. It needs end replacing "else" but i wont remove else. Thanks for your help.
tosfera Posted February 17, 2016 Posted February 17, 2016 function cancelShots() guiSetProperty( GUIEditor.button[1], "Disabled", "False" ) else guiSetProperty( GUIEditor.button[1], "Disabled", "True" ) end What is this? An "else" is a part of an if-statement and is totally random there, it doesn't even make sense.
Chris!i! Posted February 17, 2016 Author Posted February 17, 2016 function cancelShots() if source == GUIEditor.button[1] then guiSetProperty( GUIEditor.button[1], "Disabled", "False" ) else guiSetProperty( GUIEditor.button[1], "Disabled", "True" ) end end Okay so, i've added an If statement, still didn't work.
tosfera Posted February 17, 2016 Posted February 17, 2016 function cancelShots() if source == GUIEditor.button[1] then guiSetProperty( GUIEditor.button[1], "Disabled", "False" ) else guiSetProperty( GUIEditor.button[1], "Disabled", "True" ) end end Okay so, i've added an If statement, still didn't work. That part should work now. It shouldn't give you the error now.
Chris!i! Posted February 17, 2016 Author Posted February 17, 2016 It still give me same error. I've changed the script its not this addEventHandler("onClientGUIClick", GUIEditor.button[1], function() setElementData(localPlayer, "anti.repeater", true) if ( getElementData(localPlayer, "anti.repeater") == true ) then timer[source] = setTimer( function() guiSetProperty( GUIEditor.button[1], "Disabled", "False" ) setElementData(localPlayer, "anti.repeater", false) removeEventHandler("onClientGUIClick", GUIEditor.button[1], cancelShots) end, 10000, 1 ) addEventHandler("onClientGUIClick", GUIEditor.button[1], cancelShots) end end end) --HERE IT GIVES ME ERROR ) EXPECTED TO CLOSE THE FUNCTION function cancelShots() if source == GUIEditor.button[1] then guiSetProperty( GUIEditor.button[1], "Disabled", "False" ) else guiSetProperty( GUIEditor.button[1], "Disabled", "True" ) end end
Chris!i! Posted February 17, 2016 Author Posted February 17, 2016 I changed it because it still didnt work.
Dimos7 Posted February 17, 2016 Posted February 17, 2016 addEventHandler("onClientGUIClick", GUIEditor.button[1], function() setElementData(localPlayer, "anti.repeater", true) if ( getElementData(localPlayer, "anti.repeater") == true ) then timer[source] = setTimer( function() guiSetProperty( GUIEditor.button[1], "Disabled", "False" ) setElementData(localPlayer, "anti.repeater", false) removeEventHandler("onClientGUIClick", GUIEditor.button[1], cancelShots) end, 10000, 1 ) addEventHandler("onClientGUIClick", GUIEditor.button[1], cancelShots) end end) function cancelShots() if source == GUIEditor.button[1] then guiSetProperty( GUIEditor.button[1], "Disabled", "False" ) else guiSetProperty( GUIEditor.button[1], "Disabled", "True" ) end end
Chris!i! Posted February 17, 2016 Author Posted February 17, 2016 It needs 2 buttons to be disabled the button why
Chris!i! Posted February 17, 2016 Author Posted February 17, 2016 And even if i pressed 2 times, it wont be unblocked again ..
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