#Stun system

1 messages · Page 1 of 1 (latest)

worthy zodiac
#

what's the best way to make a stun system (so that the player couldnt use multiple abilities at the same time)

old saddle
#

what you're referring to is what is commonly referred to by the Roblox community as a "debounce" and by others as a "guard", NOT a "stun"

#

the general flow of your program is:

input->(match with some ability)->((the ability can be reused) ? (reuse the ability) : (do nothing))

#

for stuns, you literally just compound your guard condition with not only the cooldown checker (if you want one) but also whether or not your player is stunned

#

for stuns, you might consider having a state-per-player approach containing either one or multiple properties that influence your conditional io

#

for disabling the state (true to false), you may consider using another thread from task.delay to wait for the stun timer to end and reset your stun state property

haughty flicker
#

Just add debounce and iframes