Here is the first move script.
01 | local Player = game.Players.LocalPlayer |
02 |
03 | local Character = Player.Character or Player.CharacterAdded:Wait() |
04 |
05 | local debounce = false |
06 | script.Parent.MouseButton 1 Click:Connect( function () |
07 | if Character.HumanoidRootPart.Anchored = = false then |
08 | if debounce = = false then |
09 |
10 | debounce = true |
11 |
12 | if Player.leaderstats.Nature.Value = = "Fire" then |
13 | game.ReplicatedStorage.FireWall:FireServer() |
14 | elseif Player.leaderstats.Nature.Value = = "Grass" then |
15 | game.ReplicatedStorage.GWall 2 :FireServer() |
Even after waiting for the 9 seconds, I cant use the move or any other moves from this script.
Here is the second script
01 | local Player = game.Players.LocalPlayer |
02 |
03 | local Character = Player.Character or Player.CharacterAdded:Wait() |
04 |
05 | local debounce = false |
06 | script.Parent.MouseButton 1 Click:Connect( function () |
07 | if Character.HumanoidRootPart.Anchored = = false then |
08 | if not debounce then |
09 |
10 | debounce = true |
11 |
12 | if Player.leaderstats.Nature.Value = = "Fire" then |
13 | game.ReplicatedStorage.ShootFireBall:FireServer() |
14 | elseif Player.leaderstats.Nature.Value = = "Grass" then |
15 | game.ReplicatedStorage.ShootGrassBall:FireServer() |
I dont know why, but its the same thing with this script. After using this move, the cooldown timer never goes back to false.
i've been having the same problem to, i think its just roblox. After I wait the timer the rest of the code breaks, i have had to make whole timers to fix this such as below. Hopefully ROBLOX fixes this. The timer is just a demonstration of what i've had to do!
01 | local Timer = { } |
02 | Timer.__index = Timer |
03 |
04 | function Timer.new() |
05 | local self = setmetatable ( { } , Timer) |
06 |
07 | self._finishedEvent = Instance.new( "BindableEvent" ) |
08 | self.finished = self._finishedEvent.Event |
09 |
10 | self._running = false |
11 | self._startTime = nil |
12 | self._duration = nil |
13 |
14 | return self |
15 | end |
Never Mind, I actually just figured this out on my own.
01 | local Player = game.Players.LocalPlayer |
02 |
03 | local Character = Player.Character or Player.CharacterAdded:Wait() |
04 |
05 | local debounce = false |
06 | script.Parent.MouseButton 1 Click:Connect( function () |
07 | if Character.HumanoidRootPart.Anchored = = false then |
08 | if not debounce then |
09 |
10 | debounce = true |
11 |
12 | if Player.leaderstats.Nature.Value = = "Fire" then |
13 | game.ReplicatedStorage.ShootFireBall:FireServer() |
14 | elseif Player.leaderstats.Nature.Value = = "Grass" then |
15 | game.ReplicatedStorage.ShootGrassBall:FireServer() |
I forgot to end the if Player.leaderstats.Nature.Value == "Fire" then
Lol