Jump to content

Button Anti Spam Error


Chris!i!

Recommended Posts

Posted
 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.

Posted
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.

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

Posted
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.

Posted
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.

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

Posted

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 

Posted
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 

 

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...