local m = Instance.new("Message") m.Name = "TwoOrMore" local Player = 0 game.Players.PlayerAdded:connect(function() if game.Players.NumPlayers == 1 or game.Players.NumPlayers <=1 then m.Parent = game.Workspace Player = Player + 1 m.Text = "There must be "..Player.." more player(s) for the game to start." for i,v in pairs(game.Players:GetChildren()) do if v:IsA("Player")then repeat wait(0)until v and v.Character and v:GetMouse()and v.Character:FindFirstChild("Torso")and v.Character:FindFirstChild("Humanoid") v.Character.Torso.Anchored = true v.Character.Humanoid.Name = "humanoid" elseif game.Players.NumPlayers >= 1 then if m ~= nil then m.Parent = nil Player = Player - 1 for i, v in pairs(game.Players:GetChildren()) do if v:IsA("Player")then repeat wait(0)until v and v.Character and v:GetMouse()and v.Character:FindFirstChild("Torso")and v.Character:FindFirstChild("humanoid") v.Character.Torso.Anchored = false v.Character.humanoid.Name = "Humanoid" end end end end end end end)
So I want to make the game check if there is more then 1 player every 10 seconds so that if there were more then one but then they left and there was one left it would freeze their torso.
Also how do I make this script work?
Playing = false wait(5) if game.Players.NumPlayers ~= 1 then for i,v in pairs(game.Players:GetChildren()) do v.Character.Torso.CFrame = CFrame.new(-551.6, 18.699, 164.8) Playing = true end
Just copy this instead of the previous one
while true do wait() local m = Instance.new("Message") m.Name = "TwoOrMore" local Player = 0 game.Players.PlayerAdded:connect(function() if game.Players.NumPlayers == 1 or game.Players.NumPlayers <=1 then m.Parent = game.Workspace Player = Player + 1 m.Text = "There must be "..Player.." more player(s) for the game to start." for i,v in pairs(game.Players:GetChildren()) do if v:IsA("Player")then repeat wait(0)until v and v.Character and v:GetMouse()and v.Character:FindFirstChild("Torso")and v.Character:FindFirstChild("Humanoid") v.Character.Torso.Anchored = true v.Character.Humanoid.Name = "humanoid" elseif game.Players.NumPlayers >= 1 then if m ~= nil then m.Parent = nil Player = Player - 1 for i, v in pairs(game.Players:GetChildren()) do if v:IsA("Player")then repeat wait(0)until v and v.Character and v:GetMouse()and v.Character:FindFirstChild("Torso")and v.Character:FindFirstChild("humanoid") v.Character.Torso.Anchored = false v.Character.humanoid.Name = "Humanoid" end end end end end end end) wait(3) end