Advertisement
Guest User

Untitled

a guest
Apr 15th, 2014
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.55 KB | None | 0 0
  1. local maps = game.Lighting.Maps:GetChildren()
  2. local pickedMap = nil
  3. local h = Instance.new("Hint")
  4. local m = Instance.new("Message")
  5. local plyrs = 2-- least amount of players needed to play
  6. local Special = nil -- nothing
  7.  
  8. function round(a,b)
  9. return math.floor((a/b)+0.5)*b
  10. end
  11.  
  12. function findAlive()
  13. local alive = 0
  14. local playerLIST = game.Players:GetChildren()
  15. for i = 1, #playerLIST do
  16.        if playerLIST[i].Alive.Value == true then
  17.        alive = alive + 1
  18.        end
  19. end
  20. local total = 28/alive
  21. local p = round(total,1)
  22. print("Round Total: "..p)
  23. local playerLIST = game.Players:GetChildren()
  24. for i = 1, #playerLIST do
  25.        if playerLIST[i].Alive.Value == true then
  26.        playerLIST[i].leaderstats.Points.Value = playerLIST[i].leaderstats.Points.Value + p
  27.        end
  28. end
  29. if alive == 0 then
  30. h.Parent = game.Workspace
  31. h.Text = Special.Name.. " beat everyone. "
  32. wait(4)
  33. h.Text = Special.Name.." Wins!"
  34. wait(5)
  35. if it ~= nil then
  36. it.leaderstats.Points.Value = it.leaderstats.Points.Value + 50
  37. wait(2)
  38. h:remove()
  39. end
  40. end
  41. local list = game.Players:children()
  42. for i = 1, #list do
  43.        if list[i].Character ~= nil then
  44.        list[i].Character:BreakJoints()
  45.        end
  46. end
  47. pickedMap:remove()
  48. local minutes = 0
  49. local seconds = 30
  50. m.Parent = game.Workspace
  51. for i = 1, (minutes+1) do
  52.       for i = 1, (seconds+1) do
  53.              if seconds < 10 then
  54.              m.Text = minutes..":0"..seconds.." till next round!"
  55.              else
  56.              m.Text = minutes..":"..seconds.." till next round!"
  57.              end
  58.       seconds = seconds - 1
  59.       wait(1)
  60.       end
  61. seconds = 59
  62. minutes = minutes - 1
  63. end
  64. m:remove()
  65. CheckPlayers()
  66. end
  67.  
  68.  
  69. function ItCountDown()
  70. local walls = game.Workspace:GetChildren()
  71. for i = 1,#walls do if walls[i].className == "Part" then walls[i].Transparency = 0.4 end end
  72. local minutes = 2 -- how many minutes it has to find everyone
  73. local seconds = 30 -- how many seconds it has to find everyone
  74. h.Parent = game.Workspace
  75. for i = 1, (minutes+1) do
  76.       for i = 1, (seconds+1) do
  77.              if seconds < 10 then
  78.              h.Text = minutes..":0"..seconds.." Left for the Special to beat the players"
  79.              else
  80.              h.Text = minutes..":"..seconds.." Left for it to beat the players"
  81.              end
  82.       seconds = seconds - 1
  83.       wait(1)
  84.       end
  85. seconds = 59
  86. minutes = minutes - 1
  87. end
  88. h:remove()
  89. m.Parent = game.Workspace
  90. m.Text = "Round won!"
  91. wait(3)
  92. m:remove()
  93. findAlive()
  94. end
  95.  
  96. function Teleport_It()
  97. if it ~= nil then
  98.         if Speical.Character ~= nil then
  99.                 if it.Character.Humanoid.Health > 0 then
  100.                 it.Character.Name = "Special"
  101.                 local s = game.Lighting.ItScript:clone()
  102.                 s.Parent = Special.Character
  103.                 s.owner.Value = Special.Name
  104.                 game.Lighting:findFirstChild("Trap[3]"):clone().Parent = it.Backpack
  105.                 game.Lighting:findFirstChild("Fake It[2]"):clone().Parent = it.Backpack
  106.         local location = pickedMap.Spawns.ItSpawn
  107.         it.Character.Torso.CFrame = CFrame.new(Vector3.new(location.Position.x,location.Position.y + 3,location.Position.z))
  108.                 wait(0.2)
  109.                 end
  110.         end
  111. ItCountDown()
  112. else
  113. h.Text = "'Special' left the game!"
  114. wait(2)
  115. h.Text = "Re-Starting game!"
  116. wait(2)
  117. h:remove()
  118. local list = game.Players:children()
  119. for i = 1, #list do
  120.        if list[i].Character ~= nil then
  121.        list[i].Character:BreakJoints()
  122.        list[i].Alive.Value = false
  123.        end
  124. end
  125. CheckPlayers()
  126. end
  127. end
  128.  
  129.  
  130. function HideCountDown()
  131. local minutes = 1 -- how many minutes hiders have to hide
  132. local seconds = 30-- how many seconds hiders have to hide
  133. h.Parent = game.Workspace
  134. for i = 1, (minutes+1) do
  135.       for i = 1, (seconds+1) do
  136.              if seconds < 10 then
  137.              h.Text = minutes..":0"..seconds.." left to hide."
  138.              else
  139.              h.Text = minutes..":"..seconds.." left to hide."
  140.              end
  141.       seconds = seconds - 1
  142.       wait(1)
  143.       end
  144. seconds = 59
  145. minutes = minutes - 1
  146. end
  147. m.Parent = game.Workspace
  148. m.Text = "Let's Kick it up a notch "
  149. wait(2)
  150. m:remove()
  151. Teleport_It()
  152. end
  153.  
  154. function Choose_It()
  155. h:remove()
  156. local list = game.Players:GetChildren()
  157. m.Parent = game.Workspace
  158. local f = 1
  159. local random = math.random(30,45)
  160.       for i = 1, random do
  161.       it = list[f]
  162.       m.Text = "Choosing to be Special: "..Special.Name
  163.       f = f + 1
  164.              if f > #list then
  165.              f = 1
  166.              end
  167.       wait(0.2)
  168.       end
  169. m.Text = it.Name.." has been chosen to be the Special!"
  170. wait(4)
  171. m:remove()
  172. Start()
  173. end
  174.  
  175. function Start()
  176. local po = game.Workspace:GetChildren()
  177. for i = 1,#po do
  178. if po[i].Name == "Trap" or po[i].Name == "It " then
  179. po[i]:remove()
  180. end
  181. end
  182. h.Parent = game.Workspace
  183. local players = game.Players:GetChildren()
  184. local spawns = pickedMap.Spawns:GetChildren()
  185. local d = 1
  186. for x = 1, #players do
  187.         if players[x] ~= it then
  188.                 if players[x].Character ~= nil then
  189.                 if players[x].Character.Humanoid.Health > 0 then
  190.                 players[x].Alive.Value = true
  191.                 players[x].Character.Head.Transparency = 1
  192.                 h.Text = "Spawning "..players[x].Name
  193.         local location = spawns[d]
  194.         players[x].Character.Torso.CFrame = CFrame.new(Vector3.new(location.Position.x,location.Position.y + 3,location.Position.z))
  195.                 wait(0.2)
  196.                 end
  197.                 end
  198.         end
  199. d = d + 1
  200.         if d > #spawns then
  201.         d = 1
  202.         end
  203. end
  204. local walls = game.Workspace:GetChildren()
  205. for i = 1,#walls do if walls[i].className == "Part" then walls[i].Transparency = 0 end end
  206. h.Text = "All Hiders Ready!"
  207. wait(2)
  208. m.Parent = game.Workspace
  209. m.Text = "Hiders, Start Hiding!!!"
  210. wait(3)
  211. h:remove()
  212. m:remove()
  213. HideCountDown()
  214. end
  215.  
  216. function Choose_Level()
  217. local pM = maps[math.random(1, #maps)]
  218. pickedMap = pM:clone()
  219. pickedMap.Parent = game.Workspace
  220. m.Parent = game.Workspace
  221. m.Text = "Map Chosen: "..pickedMap.Name
  222. wait(6)
  223. local time = 5
  224.       for i = 1, time do
  225.       h.Text = "Choosing 'Special' in "..time
  226.       time = time - 1
  227.       wait(1)
  228.       end
  229. m:remove()
  230. Choose_It()
  231. end
  232.  
  233. function CheckPlayers()
  234. if game.Players.NumPlayers < plyrs then
  235. h.Parent = game.Workspace
  236. h.Text = "Not enough players"
  237. wait(1)
  238. CheckPlayers()
  239. else
  240. h.Parent = game.Workspace
  241. h.Text = "Enough Players!"
  242. wait(1.3)
  243. h.Text = "Choosing Map..."
  244. wait(1)
  245. h.Text = "Choosing Map.."
  246. wait(1)
  247. h.Text = "Choosing Map."
  248. wait(1)
  249. h:remove()
  250. Choose_Level()
  251. end
  252. end
  253.  
  254. wait(1)
  255. CheckPlayers()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement