while true do wait() local good = false for _,v in pairs(game.Players:GetChildren()) do alive = v:FindFirstChild("Alive") if v.Alive.Value == true then if v.Name ~= game.Workspace.GameScript.ChosenValue.Value then if alive.Value == true then good = true script.Parent.Game.Value = true elseif good == false then script.Parent.Game.Value = false end end end end end
The objective of this is to change the value of the game if all the players die. This script is located in the main game script, but when the game starts, it automatically ends even if there are players alive. (NOTE: The code isn't directly inside the main script, the main script opens up and there are multiple scripts and values)
Can you make it so that it is in script form?