Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local alive = {}
- local aliveplrs = 0
- game.Players.PlayerAdded:Connect(function(plr)
- print(plr.Name)
- local char = plr.CharacterAdded:Wait()
- char.Humanoid.Died:Connect(function()
- for i = 1,#alive do
- if alive[i] == plr.Name then
- table.remove(alive,i)
- aliveplrs = aliveplrs -1
- print(plr.Name .. " has been removed from the array!")
- else
- print("Player was not found.")
- end
- end
- end)
- end)
- function map()
- workspace.Message.Text = "1 Minute til next game."
- workspace.lobby:Play()
- wait(3)
- workspace.lobby:Stop()
- workspace.Five:Play()
- wait(1)
- workspace.Four:Play()
- wait(1)
- workspace.Three:Play()
- wait(1)
- workspace.Two:Play()
- wait(1)
- workspace.One:Play()
- wait(1)
- workspace.freshmeat:Play()
- for i,v in pairs(game.Players:GetPlayers()) do
- v.Character.HumanoidRootPart.Position = Vector3.new(0, 40, -64)
- table.insert(alive,v.Name)
- aliveplrs = i
- workspace.Message.Text = "A game is in progress."
- v.TeamColor = game.Teams.Alive.TeamColor
- local maps = game.Lighting.Maps:GetChildren()
- local choice = maps[math.random(1,#maps)]
- choice:Clone().Parent = workspace
- wait(40)
- if aliveplrs >0 then
- workspace.cheer:Play()
- workspace.Message.Text = "Game Ended. Restarting..."
- workspace[choice.Name]:Destroy()
- wait(10)
- map()
- aliveplrs = 0
- else
- workspace.evil:Play()
- workspace.Message.Text = "All Players died! Restarting Game..."
- workspace[choice.Name]:Destroy()
- wait(10)
- map()
- aliveplrs = 0
- end
- end
- end
- map()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement