Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local maps = game.Lighting.Maps:GetChildren()
- local pickedMap = nil
- local h = Instance.new("Hint")
- local m = Instance.new("Message")
- local plyrs = 2-- least amount of players needed to play
- local Special = nil -- nothing
- function round(a,b)
- return math.floor((a/b)+0.5)*b
- end
- function findAlive()
- local alive = 0
- local playerLIST = game.Players:GetChildren()
- for i = 1, #playerLIST do
- if playerLIST[i].Alive.Value == true then
- alive = alive + 1
- end
- end
- local total = 28/alive
- local p = round(total,1)
- print("Round Total: "..p)
- local playerLIST = game.Players:GetChildren()
- for i = 1, #playerLIST do
- if playerLIST[i].Alive.Value == true then
- playerLIST[i].leaderstats.Points.Value = playerLIST[i].leaderstats.Points.Value + p
- end
- end
- if alive == 0 then
- h.Parent = game.Workspace
- h.Text = Special.Name.. " beat everyone. "
- wait(4)
- h.Text = Special.Name.." Wins!"
- wait(5)
- if it ~= nil then
- it.leaderstats.Points.Value = it.leaderstats.Points.Value + 50
- wait(2)
- h:remove()
- end
- end
- local list = game.Players:children()
- for i = 1, #list do
- if list[i].Character ~= nil then
- list[i].Character:BreakJoints()
- end
- end
- pickedMap:remove()
- local minutes = 0
- local seconds = 30
- m.Parent = game.Workspace
- for i = 1, (minutes+1) do
- for i = 1, (seconds+1) do
- if seconds < 10 then
- m.Text = minutes..":0"..seconds.." till next round!"
- else
- m.Text = minutes..":"..seconds.." till next round!"
- end
- seconds = seconds - 1
- wait(1)
- end
- seconds = 59
- minutes = minutes - 1
- end
- m:remove()
- CheckPlayers()
- end
- function ItCountDown()
- local walls = game.Workspace:GetChildren()
- for i = 1,#walls do if walls[i].className == "Part" then walls[i].Transparency = 0.4 end end
- local minutes = 2 -- how many minutes it has to find everyone
- local seconds = 30 -- how many seconds it has to find everyone
- h.Parent = game.Workspace
- for i = 1, (minutes+1) do
- for i = 1, (seconds+1) do
- if seconds < 10 then
- h.Text = minutes..":0"..seconds.." Left for the Special to beat the players"
- else
- h.Text = minutes..":"..seconds.." Left for it to beat the players"
- end
- seconds = seconds - 1
- wait(1)
- end
- seconds = 59
- minutes = minutes - 1
- end
- h:remove()
- m.Parent = game.Workspace
- m.Text = "Round won!"
- wait(3)
- m:remove()
- findAlive()
- end
- function Teleport_It()
- if it ~= nil then
- if Speical.Character ~= nil then
- if it.Character.Humanoid.Health > 0 then
- it.Character.Name = "Special"
- local s = game.Lighting.ItScript:clone()
- s.Parent = Special.Character
- s.owner.Value = Special.Name
- game.Lighting:findFirstChild("Trap[3]"):clone().Parent = it.Backpack
- game.Lighting:findFirstChild("Fake It[2]"):clone().Parent = it.Backpack
- local location = pickedMap.Spawns.ItSpawn
- it.Character.Torso.CFrame = CFrame.new(Vector3.new(location.Position.x,location.Position.y + 3,location.Position.z))
- wait(0.2)
- end
- end
- ItCountDown()
- else
- h.Text = "'Special' left the game!"
- wait(2)
- h.Text = "Re-Starting game!"
- wait(2)
- h:remove()
- local list = game.Players:children()
- for i = 1, #list do
- if list[i].Character ~= nil then
- list[i].Character:BreakJoints()
- list[i].Alive.Value = false
- end
- end
- CheckPlayers()
- end
- end
- function HideCountDown()
- local minutes = 1 -- how many minutes hiders have to hide
- local seconds = 30-- how many seconds hiders have to hide
- h.Parent = game.Workspace
- for i = 1, (minutes+1) do
- for i = 1, (seconds+1) do
- if seconds < 10 then
- h.Text = minutes..":0"..seconds.." left to hide."
- else
- h.Text = minutes..":"..seconds.." left to hide."
- end
- seconds = seconds - 1
- wait(1)
- end
- seconds = 59
- minutes = minutes - 1
- end
- m.Parent = game.Workspace
- m.Text = "Let's Kick it up a notch "
- wait(2)
- m:remove()
- Teleport_It()
- end
- function Choose_It()
- h:remove()
- local list = game.Players:GetChildren()
- m.Parent = game.Workspace
- local f = 1
- local random = math.random(30,45)
- for i = 1, random do
- it = list[f]
- m.Text = "Choosing to be Special: "..Special.Name
- f = f + 1
- if f > #list then
- f = 1
- end
- wait(0.2)
- end
- m.Text = it.Name.." has been chosen to be the Special!"
- wait(4)
- m:remove()
- Start()
- end
- function Start()
- local po = game.Workspace:GetChildren()
- for i = 1,#po do
- if po[i].Name == "Trap" or po[i].Name == "It " then
- po[i]:remove()
- end
- end
- h.Parent = game.Workspace
- local players = game.Players:GetChildren()
- local spawns = pickedMap.Spawns:GetChildren()
- local d = 1
- for x = 1, #players do
- if players[x] ~= it then
- if players[x].Character ~= nil then
- if players[x].Character.Humanoid.Health > 0 then
- players[x].Alive.Value = true
- players[x].Character.Head.Transparency = 1
- h.Text = "Spawning "..players[x].Name
- local location = spawns[d]
- players[x].Character.Torso.CFrame = CFrame.new(Vector3.new(location.Position.x,location.Position.y + 3,location.Position.z))
- wait(0.2)
- end
- end
- end
- d = d + 1
- if d > #spawns then
- d = 1
- end
- end
- local walls = game.Workspace:GetChildren()
- for i = 1,#walls do if walls[i].className == "Part" then walls[i].Transparency = 0 end end
- h.Text = "All Hiders Ready!"
- wait(2)
- m.Parent = game.Workspace
- m.Text = "Hiders, Start Hiding!!!"
- wait(3)
- h:remove()
- m:remove()
- HideCountDown()
- end
- function Choose_Level()
- local pM = maps[math.random(1, #maps)]
- pickedMap = pM:clone()
- pickedMap.Parent = game.Workspace
- m.Parent = game.Workspace
- m.Text = "Map Chosen: "..pickedMap.Name
- wait(6)
- local time = 5
- for i = 1, time do
- h.Text = "Choosing 'Special' in "..time
- time = time - 1
- wait(1)
- end
- m:remove()
- Choose_It()
- end
- function CheckPlayers()
- if game.Players.NumPlayers < plyrs then
- h.Parent = game.Workspace
- h.Text = "Not enough players"
- wait(1)
- CheckPlayers()
- else
- h.Parent = game.Workspace
- h.Text = "Enough Players!"
- wait(1.3)
- h.Text = "Choosing Map..."
- wait(1)
- h.Text = "Choosing Map.."
- wait(1)
- h.Text = "Choosing Map."
- wait(1)
- h:remove()
- Choose_Level()
- end
- end
- wait(1)
- CheckPlayers()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement