Cooldowns reset upon respawn

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want cooldowns to not be reset when the player is respawned.
  2. What is the issue? Include screenshots / videos if possible!
    When a player respawns, the cooldown is also reset.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried looking up some way to check when a character respawns but I have no idea how to incorporate it. I’ve also looked for some solutions but I haven’t seen any for some reason.

Here is my code if you need it.

input.InputBegan:Connect(function(key)
	print ("Flow of Time is Stopped")
	if key.KeyCode == Enum.KeyCode.F and (Cooldown == false) and game.ReplicatedStorage.Event.InUse.Value == false then
		Cooldown = true
		local name = player.Name
		local namew = game.Workspace:FindFirstChild(name)
		game.ReplicatedStorage.Event.TimeStopEvent:FireServer()
		game.ReplicatedStorage.Event.StopTime:FireServer()
		if game.ReplicatedStorage.Event.InUse.Value == false then
		for i = 70, 200, 5 do
			wait()
			workspace.Camera.FieldOfView = i
		end
		for i = 200, 70, -5 do
			wait()
				workspace.Camera.FieldOfView = i
		end
		end
		game.ReplicatedStorage.Event.OutOfTime:FireServer()
		game.ReplicatedStorage.Event.Screenshake:Invoke()
		Cooldown = false
	end
	end)

input.InputBegan:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.F and (Cooldown == false) and game.ReplicatedStorage.Event.InUse.Value == true then
		print ("Movement through halted flow of time = true")
		game.ReplicatedStorage.Event.TSMovement:FireServer()
		Cooldown = true
		wait (30)
		Cooldown = false
	end
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

If this is a descendant of a ScreenGui then try disabling the “ResetOnSpawn” property on your ScreenGui.

It’s on a localscript in starterplayerscripts

input.InputBegan:Connect(function(key)
	print ("Flow of Time is Stopped")
	if key.KeyCode == Enum.KeyCode.F and (Cooldown == false) and game.ReplicatedStorage.Event.InUse.Value == false then
		Cooldown = true
game:FindService("StarterGui"):SetCore("ResetButtonCallback", false)
		local name = player.Name
		local namew = game.Workspace:FindFirstChild(name)
		game.ReplicatedStorage.Event.TimeStopEvent:FireServer()
		game.ReplicatedStorage.Event.StopTime:FireServer()
		if game.ReplicatedStorage.Event.InUse.Value == false then
		for i = 70, 200, 5 do
			wait()
			workspace.Camera.FieldOfView = i
		end
		for i = 200, 70, -5 do
			wait()
				workspace.Camera.FieldOfView = i
		end
		end
		game.ReplicatedStorage.Event.OutOfTime:FireServer()
		game.ReplicatedStorage.Event.Screenshake:Invoke()
		Cooldown = false
	end
	end)

input.InputBegan:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.F and (Cooldown == false) and game.ReplicatedStorage.Event.InUse.Value == true then
		print ("Movement through halted flow of time = true")
		game.ReplicatedStorage.Event.TSMovement:FireServer()
		Cooldown = true
   game:FindService("StarterGui"):SetCore("ResetButtonCallback", false)
		wait (30)
game:FindService("StarterGui"):SetCore("ResetButtonCallback", true)
		Cooldown = false
	end
end)

i dont think this would work since the script is not a descendant of startergui but ill try it