Basically, I have a script that activates when a remote event is fired and it counts down from 7, however it seems like it only works once, then the timer is just permanently 0. Is there any fixes for this?
local rem = game.ReplicatedStorage:WaitForChild("RemoteEvents"):WaitForChild("RebirthEvent")
local timer = 7
local tool = game.StarterPack:WaitForChild("Stick")
rem.OnServerEvent:Connect(function(player)
local timer = 7
player.leaderstats.Coins.Value = 0
player.leaderstats["Sword Skill"].Value = 0
player.leaderstats.Multiplier.Value += 1
while timer > 0 do
player.Backpack:ClearAllChildren()
timer -= 0.2
print(timer)
wait(0.2)
end
local stick = tool:Clone()
stick.Parent = player.Backpack
end)