Drakath Posted October 17, 2013 Share Posted October 17, 2013 function lolz(thePlayer) if spam then outputChatBox("dont spam",thePlayer,255,0,0) return end outputChatBox("works",root,0,255,0) spam = true setTimer(function() spam = false end,30000,1) end addCommandHandler("yup", lolz) How do I make anti-spam function for source ? Link to comment
Markeloff Posted October 17, 2013 Share Posted October 17, 2013 local Spam = {} function lolz(thePlayer) if ( Spam[thePlayer] ) and ( getTickCount()-Spam[thePlayer] < 30000 ) then outputChatBox("Stop spamming",root,0,255,0) else Spam[thePlayer] = getTickCount() outputChatBox("works",root,0,255,0) end addCommandHandler("yup", lolz) Not tested but try it. Link to comment
Castillo Posted October 17, 2013 Share Posted October 17, 2013 You have a missing 'end'. 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