so im making minigames and i want a script that chooses a minigame disable after players are teleported to the game. so the problem is that the script ends when the loop ends and the script doesnt get disabled. heres the script i dont know if its gonna help but ima just put it
while true do
wait(25)
local games = game.ServerStorage.Minigames:GetChildren()
if #game.Players:GetChildren() >= 2 then
game.StarterGui.MorePlayers.TextLabel.Visible = false
local choosengame = games[math.random(1,#games)]
local gameclone = choosengame:Clone()
gameclone.Parent = game.Workspace.CurrentGame
local spawns = gameclone:WaitForChild("Spawns"):GetChildren()
wait(3)
for i,v in pairs(game.Players:GetChildren()) do
v.Character:MoveTo(spawns[math.random(1,#spawns)].Position)
v.Team = game.Teams["In-Game"]
local scriptclone = script.ChangeTeamWhenDied:Clone()
scriptclone.Parent = v
scriptclone.Disabled = false
end
script.Disabled = true
end
end
any help appreciated

2 comments
Why is this even wrapped in a while loop if you want the script to stop executing after it finishes the for loop?
so the intermission starts again when a game is finished?