Hello, currently I am trying to fix an issue with a local script inside my tool.
The tool's click cool down is functional except for when a player will equip and unequip the tool very fast.
My code can be found here:
01 | local remote = game.ReplicatedStorage.Events.Greens.GreenWrite |
02 | local debounce = false |
03 |
04 |
05 | game.Players.LocalPlayer:GetMouse().Button 1 Down:Connect( function () |
06 |
07 | if not debounce then |
08 | debounce = true |
09 |
10 |
11 | remote:FireServer() |
12 | wait( 1 ) |
13 | debounce = false |
14 |
15 |
16 | end |
17 | end ) |
Nevermind, I have fixed this by setting the debounce on the server instead of locally.