So I've created a testing game where I test various magics for use in a game I'm thinking of creating, and I have recently created a new magic. Everything is fine, and works as it should, however for some reason, today, one move's cooldown only works in Studio - The Time Stop (Ultimate move). The cooldown used to work previously, but today I was fixing some bugs associated with this move and then the cooldown script stopped working. No errors, no warnings, no nothing.
This is the localscript code:
local player = game.Players.LocalPlayer
repeat wait() until player.Character.Humanoid
local debounce = false
mouse.KeyDown:connect(function(key)
if key == "x" and not debounce then
debounce = true
game.ReplicatedStorage.TimestopEvent:FireServer()
wait(60)
debounce = false
end
end)
And this is the server script code:
local b = game.Lighting.Blur
local c = game.Workspace.Camera
local e = game.Workspace.TSAura
game.ReplicatedStorage.TimestopEvent.OnServerEvent:Connect(function(player)
print("Time Stop success!")
game.Workspace["Time Stop Audio"]:Play()
wait(1.5)
b.Size = 2
game.Lighting.TimeOfDay = '14:00:00'
wait(0.05)
game.Lighting.TimeOfDay = '13:50:00'
wait(0.05)
game.Lighting.TimeOfDay = '13:00:00'
wait(0.05)
b.Size = 3
game.Lighting.TimeOfDay = '13:50:00'
wait(0.05)
game.Lighting.TimeOfDay = '12:00:00'
wait(0.05)
game.Lighting.TimeOfDay = '11:50:00'
wait(0.05)
b.Size = 5
game.Lighting.TimeOfDay = '11:00:00'
wait(0.05)
game.Lighting.TimeOfDay = '10:50:00'
wait(0.05)
b.Size = 7
game.Lighting.TimeOfDay = '10:00:00'
wait(0.05)
game.Lighting.TimeOfDay = '9:50:00'
wait(0.05)
game.Lighting.TimeOfDay = '9:00:00'
wait(0.05)
game.Lighting.TimeOfDay = '8:50:00'
wait(0.05)
game.Lighting.TimeOfDay = '8:00:00'
wait(0.05)
b.Size = 10
game.Lighting.ColorCorrection.Enabled = true
game.Lighting.TimeOfDay = '7:50:00'
wait(0.05)
e.Position = Vector3.new(player.Character.HumanoidRootPart.Position.X , player.Character.HumanoidRootPart.Position.Y + 2, player.Character.HumanoidRootPart.Position.Z)
game.Workspace.TSAura.Script.Disabled = false
game.Lighting.TimeOfDay = '7:00:00'
wait(0.05)
game.Lighting.TimeOfDay = '6:50:00'
wait(0.05)
game.Lighting.TimeOfDay = '6:00:00'
wait(0.05)
game.Lighting.TimeOfDay = '5:50:00'
wait(0.05)
b.Size = 24
game.Lighting.TimeOfDay = '5:00:00'
wait(0.05)
b.Size = 22
game.Lighting.TimeOfDay = '4:50:00'
wait(0.05)
b.Size = 20
game.Lighting.TimeOfDay = '4:00:00'
wait(0.05)
b.Size = 18
game.Lighting.Blur2.Enabled = true
game.Lighting.TimeOfDay = '3:50:00'
wait(0.05)
b.Size = 16
game.Lighting.TimeOfDay = '3:00:00'
wait(0.05)
game.Lighting.TimeOfDay = '2:50:00'
wait(0.05)
game.Lighting.TimeOfDay = '2:00:00'
wait(0.05)
game.Lighting.TimeOfDay = '1:50:00'
wait(0.05)
game.Lighting.TimeOfDay = '1:00:00'
wait(0.05)
game.Lighting.TimeOfDay = '0:50:00'
wait(0.05)
b.Size = 0
game.Lighting.TimeOfDay = '0:00:00'
wait(1.24)
game.Lighting.Blur2.Enabled = false
b.Size = 5
game.Workspace.TSAura.Script.Disabled = true
e.Transparency = 1
game.Workspace.NoMoreTS.Disabled = false
for i,v in next,workspace:GetDescendants() do if v:IsA"Part" and v.Parent:findFirstChild("Humanoid") then
v.Anchored = true
for i,s in next,workspace:GetDescendants() do if s:IsA"Script" and s.Parent:FindFirstChild("Humanoid") then
s.Disabled = true
for i,p in next,game.Players:GetDescendants() do if p:IsA"LocalScript" then
p.Disabled = true
end end
end end
end
end
end)
This is the main script that later triggers other scripts, which I will not put here as I do not believe it is very relevant to my issue.
When I press "X", the time stop itself works as planned. I'm happy with that. What I'm not happy with is the fact that although I set the debounce, or cooldown, to 60 seconds (1 minute), it only works in Studio. What I mean is if I published this to a game, I can spam "X" to stop time whenever I want, even during the time stop itself. I've searched this issue up on Google and tried some methods but they only worked on Studio - none of them worked in the real game. It used to work before, same scripts, but for some reason it just suddenly stopped working. The console logs no errors for the time stop script, so I don't know what's wrong.
Any help?

2 comments
because roblox updated something i don't know why they change it! normal leaderstats is not working not.
That's weird, although the other attacks' cooldown scripts work perfectly fine, I'm not sure what's with this script that just screws everything up.. Maybe they'll fix it soon, I don't know.