Hey there, so I am basically making an elevator for my story game but, when there's 0 players the elevator doesnt stop countdowning even though the PlayerCount.Value is set to 0, Can anyone help me with this?
local Elevator = workspace.Elevator local PlayerCount = Elevator.Count local Event = game.ReplicatedStorage.Event local Event2 = game.ReplicatedStorage.Event2 Event.OnServerEvent:Connect(function() PlayerCount.Value -= 1 end) Event2.OnServerEvent:Connect(function() PlayerCount.Value += 1 for i = 10,0,-1 do if PlayerCount.Value ~= 0 then wait(1) Elevator.CountDown.Value -= 1 else Elevator.CountDown.Value = "Waiting for players..." break end end end)
Also this is not the exact code I'm just giving an example