Ability that detects holding down a key and displays it on all clients

Im trying to make an ability where when you hold shift a shield appears and when you let go it dissapears. I already have it coded but the problem lies with structure of the module script, it gets confused when the two players use the ability and starts messing up the cooldown variables and times. How would I achieve this affect.

Heres what the ability looks like:

1 Like

Add a table called cooldown and add players to it when they activate the shield. If they are not in the table, add them and remove them when they stop holding shift

local Cooldown = {}
1 Like

But then what do I do with this table?

I mentioned above to add players If their shield isn’t active and remove them once their shield deactivates. Doing so helps your module script to differentiate between players

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.