--// Varibles \\--
local repStorage = game:GetService("ReplicatedStorage")
local Intermission = 15
local RoundTime = 600
local TextValue = repStorage.TextValue
local Players = game.Players
local WinRemote = repStorage.RemoteEvents:WaitForChild("WinRemote")
local debounce = true
--// Loop \\--
while true do
Intermission = 15
RoundTime = 60
for i = 1,15
do
wait(1)
TextValue.Value = ("Intermission: "..Intermission)
Intermission = Intermission - 1
end
repStorage.PlayerCount.Value = repStorage.PlayerCount == 0
repStorage.OrignialCount.Value = repStorage.OrignialCount.Value == 0
local debounce = true
game.ServerStorage.Map1:Clone().Parent = workspace
TextValue.Value = "teleporting Players..."
for i, players in pairs(game.Players:GetChildren()) do
local Spawns = workspace.Spawns:GetChildren()
players.Character.HumanoidRootPart.Anchored = true
repStorage.PlayerCount.Value = repStorage.PlayerCount.Value + 1
repStorage.OrignialCount.Value = repStorage.OrignialCount.Value + 1
players.Character.HumanoidRootPart.CFrame = CFrame.new(Spawns[i].Position)
players.TeamColor = BrickColor.new("Really red")
end
wait(3)
for i, players in pairs(game.Players:GetChildren()) do
players.Character.HumanoidRootPart.Anchored = false
end
for i = 1,600
do
if repStorage.OrignialCount.Value >= 2 then
wait(1)
if repStorage.PlayerCount.Value > 1 then
if RoundTime > 0 then
TextValue.Value = ("Round ends in "..RoundTime)
RoundTime = RoundTime - 1
else
TextValue.Value = "Round Ended"
wait(5)
workspace.Map1:Destroy()
break
end
else
TextValue.Value = "need more players to start"
workspace.Map1:Destroy()
break
end
end
end
end
so i made this round manager for my game the player wins if the other players fall into the lava , i tried adding a win system with a .touched but this made the game verry buggy How can i propperly make a win system?

2 comments
I recommend you add a team called "Dead" or something like that and a team called "Alive" and when someone's health is <= 0 then they get placed on the dead team and then after a certain amount of time you can put the remaining player(s) in a table and do whatever you want with it, such as changing the leaderstats or whatever
can u add me on discord and explain more?