BumpyPlayz

ServerScript 1 Intemission Timer

Dec 11th, 2019
3,033
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. game.Players.PlayerAdded:Connect(function(player)
  2.     local playercount = 0
  3.     for i, v in pairs(game.Players:GetPlayers()) do
  4.         playercount = playercount+1
  5.     end
  6.     if playercount>1 and script.Script2.Disabled == true then
  7.         script.Script2.Disabled = false
  8.     else
  9.         player:WaitForChild("PlayerGui")
  10.         game.ReplicatedStorage.NotEnoughPlayers:FireAllClients()
  11.     end
  12. end)
  13.  
  14. game.Players.PlayerRemoving:Connect(function(player)
  15.     local playercount = 0
  16.     for i,v in pairs(game.Players:GetPlayers()) do
  17.         playercount = playercount+1
  18.     end
  19.     if playercount<2 and script.Script2.Disabled == false then
  20.         script.Script2.Disabled = true
  21.         for i, plr in pairs(game.Players:GetPlayers()) do
  22.             plr.Character:FindFirstChild("Humanoid").Health = 0
  23.         end
  24.         game.ReplicatedStorage.NotEnoughPlayers:FireAllClients()
  25.     end
  26. end)
Add Comment
Please, Sign In to add comment