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

4 comments
What is Elevator in this case? Is it an IntValue?
^ if it is then use .Value, possibly op forgot that lel. Deducing this off of line 2.
it is a intvalue
also sorry i forgot to add .value but that doesnt fix it