Advertisement
SLIDERzzYT

Fixed Script

Feb 6th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. local replicatedstorage = game:GetService('ReplicatedStorage')
  2. local status = replicatedstorage:WaitForChild('Status')
  3. local mapstorage = game.Workspace:WaitForChild('mapStorage')
  4. while true do
  5. --[[
  6. while game.Players.NumPlayers>2 do
  7. status.Value = 'There needs to be 2 or more players to begin'
  8. repeat wait(2) until game.Players.NumPlayers >= 2
  9. end
  10. ]]
  11. for i = 15,0,-1 do
  12. status.Value = 'Intermission '..i
  13. wait(1)
  14. end
  15.  
  16. _G.gameplayers = {}
  17. for i, v in pairs (game.Players:GetPlayers()) do -- You forgot to add ) after ()
  18.  
  19. if v then
  20. table.insert(_G.gameplayers, v.Name)
  21. end
  22.  
  23. end
  24.  
  25. local mapsinserverstorage = game:GetService('ServerStorage'):GetChildren()
  26. local chosenmap = mapsinserverstorage [math.random(1, #mapsinserverstorage)]
  27. chosenmap:Clone().Parent = mapstorage
  28. status.Value = 'Get ready to be teleported!'
  29. wait(3)
  30. local spawns = chosenmap:WaitForChild('Spawns'):GetChildren()
  31. for _, player in pairs(game.Players:GetPlayers()) do
  32. if player and #spawns > 0 then
  33. local torso = player.Character:WaitForChild('Torso')
  34. local allspawns = math.random(1, #spawns)
  35. local randomspawn = spawns[allspawns]
  36. if randomspawn and torso then
  37. table.remove(spawns, allspawns)
  38. torso.CFrame = CFrame.new(randomspawn.Position + Vector3.new(0,2,0))
  39.  
  40. local awp = game.ReplicatedStorage.Awp
  41. local newawp = awp:Clone()
  42. newawp.Parent = player.Backpack
  43. end
  44. end
  45. end
  46.  
  47. for i = 180, 0, -1 do
  48. if i == 0 then
  49. status.Value = 'Time up!'
  50. break
  51. end
  52. wait(1)
  53. if #_G.gameplayers == 1 then
  54. for i, v in pairs(_G.gameplayers) do
  55. if v ~= nil then
  56. status.Value = v..' is the winner!'
  57. game.Players [v].leaderstats.Cash.Value = game.Players[v].leaderstats.Cash.Value + 250
  58. break
  59. end
  60.  
  61. end
  62. break
  63. else
  64. status.Value = i..'seconds remaining!'
  65. end
  66. end
  67.  
  68. mapstorage:ClearAllChildren()
  69. wait(5)
  70. endο»Ώ
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement