Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. local alive = {}
  2. local aliveplrs = 0
  3.  
  4. game.Players.PlayerAdded:Connect(function(plr)
  5. print(plr.Name)
  6. local char = plr.CharacterAdded:Wait()
  7. char.Humanoid.Died:Connect(function()
  8. for i = 1,#alive do
  9. if alive[i] == plr.Name then
  10. table.remove(alive,i)
  11. aliveplrs = aliveplrs -1
  12. print(plr.Name .. " has been removed from the array!")
  13. else
  14. print("Player was not found.")
  15. end
  16. end
  17. end)
  18. end)
  19.  
  20. function map()
  21. workspace.Message.Text = "1 Minute til next game."
  22. workspace.lobby:Play()
  23. wait(3)
  24. workspace.lobby:Stop()
  25. workspace.Five:Play()
  26. wait(1)
  27. workspace.Four:Play()
  28. wait(1)
  29. workspace.Three:Play()
  30. wait(1)
  31. workspace.Two:Play()
  32. wait(1)
  33. workspace.One:Play()
  34. wait(1)
  35.  
  36. workspace.freshmeat:Play()
  37. for i,v in pairs(game.Players:GetPlayers()) do
  38. v.Character.HumanoidRootPart.Position = Vector3.new(0, 40, -64)
  39. table.insert(alive,v.Name)
  40. aliveplrs = i
  41. workspace.Message.Text = "A game is in progress."
  42. v.TeamColor = game.Teams.Alive.TeamColor
  43. local maps = game.Lighting.Maps:GetChildren()
  44. local choice = maps[math.random(1,#maps)]
  45. choice:Clone().Parent = workspace
  46. wait(40)
  47. if aliveplrs >0 then
  48. workspace.cheer:Play()
  49. workspace.Message.Text = "Game Ended. Restarting..."
  50. workspace[choice.Name]:Destroy()
  51. wait(10)
  52. map()
  53. aliveplrs = 0
  54. else
  55. workspace.evil:Play()
  56. workspace.Message.Text = "All Players died! Restarting Game..."
  57. workspace[choice.Name]:Destroy()
  58. wait(10)
  59. map()
  60. aliveplrs = 0
  61. end
  62. end
  63. end
  64. map()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement