Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game.Players.PlayerAdded:Connect(function(player)
- local playercount = 0
- for i, v in pairs(game.Players:GetPlayers()) do
- playercount = playercount+1
- end
- if playercount>1 and script.Script2.Disabled == true then
- script.Script2.Disabled = false
- else
- player:WaitForChild("PlayerGui")
- game.ReplicatedStorage.NotEnoughPlayers:FireAllClients()
- end
- end)
- game.Players.PlayerRemoving:Connect(function(player)
- local playercount = 0
- for i,v in pairs(game.Players:GetPlayers()) do
- playercount = playercount+1
- end
- if playercount<2 and script.Script2.Disabled == false then
- script.Script2.Disabled = true
- for i, plr in pairs(game.Players:GetPlayers()) do
- plr.Character:FindFirstChild("Humanoid").Health = 0
- end
- game.ReplicatedStorage.NotEnoughPlayers:FireAllClients()
- end
- end)
Add Comment
Please, Sign In to add comment