m = Instance.new(Message) m.Name = TwoOrMore m.Message = "There must be 2 or more players to start" if game.Players.NumPlayers == 1 then game.Workspace.m for i,v in pairs(game.Players:GetChildren()) do v.Character.Torso.Anchored = true elseif game.Players.NumPlayers ~= 1 then if game.Workspace.m = true game.Workspace.m:Destroy() for i,v in pairs(game.Players:GetChildren()) do v.Character.Torso.Anchored = false end end
Nothing happens?
I had done the script in two different functions and events, I think it should work now;
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) game.Players.PlayerRemoving: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)
I hope this helps!
All I could Scrap out of this...
m = Instance.new("Message", game.Workspace) m.Name = "TwoOrMore" m.Text = "There must be 2 or more players to start" if game.Players.NumPlayers == 1 then for i,v in pairs(game.Players:GetChildren()) do v.Character.Torso.Anchored = true end elseif game.Players.NumPlayers ~= 1 then if m ~= nil then m.Parent = nil end end
Hope It works.
So
m = Instance.new("Message") m.Name = "TwoOrMore" m.Text = "There must be 2 or more players to start" if game.Players.NumPlayers == 1 then m.Parent = game.Workspace for i,v in pairs(game.Players:GetChildren()) do v.Character.Torso.Anchored = true elseif game.Players.NumPlayers ~= 1 if m ~= nil then m.Parent = nil for i,v in pairs(game.Players:GetChildren()) do v.Character.Torso.Anchored = false end end end end