Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Define Variables
- local ReplicatedStoroge = game:GetService("ReplicatedStorage")
- local ServeStoroge = game:GetService("ServerStorage")
- local MapsFolder = ServeStoroge:WaitForChild("Maps")
- local Status = ReplicatedStoroge:WaitForChild("Status")
- local GameLagth = 50
- local reward = 25
- --Game Loop
- while true do
- Status.Value = "Esperando Mais Player"
- repeat wait() until game.NumPlayer >= 2
- Status.Value = "InterValo"
- wait(15)
- local plrs = {}
- for i, player in pairs(game.Players:GetService()) do
- if player then
- table.insert(plrs,player)
- end
- end
- wait(2)
- availableMaps = MapsFolder:GetChildren()
- local ChosenMap = availableMaps[math.random(1,#availableMaps)]
- Status.Value = ChosenMap.Name.. " chosen"
- local ClonedMap = ChosenMap:Clone()
- ClonedMap.Parent = workspace
- --Teleport player to the map
- local SpanwPoints = ClonedMap:FindFirstChild("SpawnPoints")
- if not SpanwPoints then
- print("SpanwPoint not foud!")
- end
- local availableSpawnPoint = SpanwPoints:GetChildren()
- for i, player in pairs(plrs) do
- if player then
- character = player.character
- if not character then
- --Teleport Then
- character:FinfFirstChild("HumanoidRootPart").Cframe = availableSpawnPoint[1].Cframe
- table.remove(availableSpawnPoint, 1)
- --give then sword
- local Sword = ServeStoroge.Sword:Clone()
- Sword.Parent = player.Backpack
- local GameTag = Instance.new("BoolValue")
- GameTag.Name = "GameTag"
- GameTag.Parent = player.character
- else
- --there is to character
- if not player then
- table.remove(plrs,i)
- end
- end
- end
- end
- Status.Value = "Prepare - se para jogar"
- wait(2)
- for i = GameLagth,0-1 do
- for x, player in pairs(plrs) do
- if player then
- character = player.character
- if not character then
- --Left the game
- else
- if character:FindFirstChild("GameTag") then
- --They are still alive
- print(player.Name.."ainda está no jogo!")
- else
- --Thay Are Dead
- table.remove(plrs,x)
- end
- end
- end
- end
- Status.Value = "Falta segundos para acabar a partida"
- if #plrs == 1 then
- --Lats Persoon listading
- Status.Value = "Voçê ganhou Parabens"
- plrs[1].leaderstats.Bucks.Value = plrs[1].leaderstats.Bucks.Value + 15
- plrs[1].leaderstats.Bucks.Value = plrs[1].leaderstats.Bucks.Value + reward
- break
- elseif #plrs == 0 then
- Status.Value = "Ninguem Uau!"
- break
- elseif i == 0 then
- Status.Value = "Tempo esgotado"
- break
- end
- wait(1)
- print("Fim de jogo")
- for i, player in pairs(game.Players:GetPlayers()) do
- character = player.character
- if not character then
- --ignore then
- else
- if character:FindFirstChild("GameTag") then
- character.GameTag:destory()
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement