BumpyPlayz

ServerScript 2 Intemission Timer

Dec 11th, 2019
2,822
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. local lobbytime = 10
  2. local waittime = 5
  3. local roundtime = 20
  4.  
  5. -- change the timing according to your wish
  6.  
  7. local timev = game.ReplicatedStorage.Time
  8. local manager = game.ReplicatedStorage.Manager
  9.  
  10. while true do
  11. manager.Value = "Lobby"
  12. timev.Value = lobbytime
  13.  
  14. repeat
  15. timev.Value = timev.Value - 1
  16. wait(1)
  17. until timev.Value == 0
  18.  
  19. manager.Value = "Round Starting"
  20. timev.Value = waittime
  21.  
  22. repeat
  23. timev.Value = timev.Value - 1
  24. wait(1)
  25. until timev.Value == 0
  26.  
  27. local unusedspawns = game.Workspace.Map.Spawns:GetChildren()
  28.  
  29. for i,plr in pairs(game.Players:GetPlayers()) do
  30. local allocated = false
  31. local spawns = game.Workspace.Map.Spawns:GetChildren()
  32. for i,spawnlo in pairs(spawns) do
  33. for ind, unused in pairs(unusedspawns) do
  34. if spawnlo==unused and allocated==false then
  35. allocated = true
  36. table.remove(unusedspawns, ind)
  37. if plr.Character:FindFirstChild("Torso") then
  38. plr.Character.Torso.CFrame = CFrame.new(spawnlo.Position + Vector3.new(0,3,0))
  39. elseif plr.Character:FindFirstChild("UpperTorso") then
  40. plr.Character.UpperTorso.CFrame = CFrame.new(spawnlo.Position + Vector3.new(0,3,0))
  41. end
  42. end
  43. end
  44. end
  45. end
  46.  
  47. manager.Value = "Round In Progress"
  48. timev.Value = roundtime
  49.  
  50. repeat
  51. timev.Value = timev.Value - 1
  52. wait(1)
  53. until timev.Value == 0
  54.  
  55. for i, player in pairs(game.Players:GetPlayers()) do
  56. player.Character:FindFirstChild("Humanoid").Health = 0
  57. end
  58.  
  59. manager.Value = "Round Ending"
  60. timev.Value = waittime
  61.  
  62. repeat
  63. timev.Value = timev.Value - 1
  64. wait(1)
  65. until timev.Value == 0
  66. end
Add Comment
Please, Sign In to add comment