Anyone know how to disable a ClickDetector?
I am making a farming button. But I want to prevent spams while the wheat is regrowing. Is there anyway I can disable the ClickDetector when the wheat has grown again? This is my code:
01 | function onClicked(player) |
02 | game.Players:FindFirstChild(player.Name).leaderstats.Coins.Value = game.Players:FindFirstChild(player.Name).leaderstats.Coins.Value + 100 |
03 | game.Players.thenasafarouk.leaderstats.Coins.Value = game.Players.thenasafarouk.leaderstats.Coins.Value + 20 |
05 | game.Workspace.WheatSix.Transparency = 1 |
06 | game.Workspace.WheatFive.Transparency = 1 |
07 | game.Workspace.WheatFour.Transparency = 1 |
08 | game.Workspace.WheatThree.Transparency = 1 |
09 | game.Workspace.WheatTwo.Transparency = 1 |
10 | game.Workspace.WheatOne.Transparency = 1 |
12 | game.Workspace.WheatSix.Transparency = 0 |
13 | game.Workspace.WheatFive.Transparency = 0 |
14 | game.Workspace.WheatFour.Transparency = 0 |
15 | game.Workspace.WheatThree.Transparency = 0 |
16 | game.Workspace.WheatTwo.Transparency = 0 |
17 | game.Workspace.WheatOne.Transparency = 0 |
20 | script.Parent.ClickDetector.MouseClick:connect(onClicked) |
Thanks, thenasafarouk