Author Topic: Event Delays  (Read 804 times)

Can somebody help me in a way to set up events so they have a delay between them and players can't spam it non stop?

0 OnActivate -> Self -> pootis
0 OnActivate -> Self -> setEventEnabled 0 false
2000 onActivate -> Self -> setEventEnabled 0 true


Change 2000 to the delay time and you're set!

And the term you're looking for is "debounce" or timeout. Delay would be wait a while before performing the event.

that doesn't solve my issue. I already know about that but if somebody rapidclicks it then they can still spam it and cause the "debounce" to delay further.

for example. If I have a button that adds velocity up by 20, and you cant click it again by the delay i set, which is 2000, that'll work if they click it just once. but if they spamclick, they can just do it infinitely.

Click it once, the event will fire and will disable itself for some time.

Rapid-click it and the event will fire once and will disable itself for some time.

Did you even try it?

no i just ignored what you said and jerked myself off
of course i tried it
just look at the events

You could just toggle the raycasting, although that may interfere with what you're doing depending on what you want to do

its not button based its when the player selects the comma key.


Also I said "SetEventEnabled", not "ToggleEventEnabled". Try that.

there is no seteventenabled. at least not by default. also i used variables and it worked better.

unlocked for other solutions to the problem if people are having issues

there is no seteventenabled. at least not by default. also i used variables and it worked better.
there is, its toggleEventEnabled or something like that. I was shocked too when i learned it was default, but it only makes sense.

There's also setEventEnabled if you look carefully.

Don't even have to look carefully, it's alphabetical.