Jetpack cool down does not work

local Cooldown = 0

local Cool = script.Parent.Configuration.Cooldown.Value
local Power = script.Parent.Configuration.Power.Value

Power = Power * 1000

script.Parent.Handle.VectorForce.Force = Vector3.new(Power, 0, 0)

script.Parent.Activated:Connect(function()
	
	if Cooldown == 0 then
		
		Cooldown = 0
		
		script.Parent.Handle.Attachment.ParticleEmitter.Enabled = true
		
		script.Parent.Handle.Attachment.ParticleEmitter2.Enabled = true
		
		script.Parent.Handle.VectorForce.Enabled = true
		
		script.Parent.Handle.Part.Color = Color3.fromRGB(0, 0, 0)
		
		task.wait(0.5)
		
		script.Parent.Handle.VectorForce.Enabled = false
		
		script.Parent.Handle.Attachment.ParticleEmitter.Enabled = false
		
		script.Parent.Handle.Attachment.ParticleEmitter2.Enabled = false
		
		task.wait(Cool)
		
		script.Parent.Handle.Part.Color = Color3.fromRGB(0, 255, 0)
		
		Cooldown = 0
	
	end
end)

You have to click / tap on the screen to activate the jetpack. There is a cooldown, so after the jetpack is activated you must wait to use it again. But the cooldown does not work for some reason. You can click on the screen multiple times while the jepack is active and it will still work which means you can fly in the air pretty much forever. Anyone have a fix? I’ll mark you the solution

1 Like

You set the cooldown to 0, so it will not have a cooldown.

1 Like

if cooldown is 0 then it wont work. cause its 0

1 Like

I do see that you have “Cool” as the cooldown but that might be the issue as it could be 0 as well.

1 Like

“Cool” is the cooldown so changing the “Cooldown” to anything else wouldn’t make a change. I’ve already tried doing that as well and it didn’t work.

2 Likes

So when you start it

The second zero should be lets say 1 and here in the end:

it should be 0 so after the use you can use it again so its not 1.

It’s so you can’t spam it

2 Likes

Thank you, I should have noticed that :smile:

1 Like

No problem! That can happen to anybody :wink:

1 Like

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