Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Countdown = game:GetService('ReplicatedStorage'):WaitForChild('Values'):WaitForChild('Countdown')
- local SideText = game:GetService('ReplicatedStorage'):WaitForChild('Values'):WaitForChild('SideText')
- local MapchooseName = game:GetService('ReplicatedStorage'):WaitForChild('Values'):WaitForChild('MapchooseName')
- local DefaultSpawn = game:GetService('Workspace'):WaitForChild('Main'):WaitForChild('Lobby'):WaitForChild('Spawnpoints')
- local cooldown = 1
- while game:GetService("RunService").Heartbeat:Wait() do
- for _,plr in next, game.Players:GetPlayers() do
- for i = 20,0,-1 do
- wait(1)
- Countdown.Value = i
- SideText.Value = ' Seconds until the next match'
- if i == 0 then
- wait()
- print('Wave is starting')
- wait(cooldown)
- SideText.Value = ' The wave is now starting'
- local mapchoose = math.random(1,2)
- MapchooseName.Value = mapchoose
- game:GetService('ServerStorage'):WaitForChild(MapchooseName.Value).Parent = game:GetService('Workspace')
- local ToolToEquip = game:GetService('ReplicatedStorage'):WaitForChild('Tools'):WaitForChild(1) or game:GetService('ReplicatedStorage'):WaitForChild('EquippedTools'):WaitForChild(ToolEquipped)
- local ToolToEquipCloned = ToolToEquip:Clone()
- ToolToEquipCloned.Parent = plr.Backpack
- local SpawnToTeleport = math.random(1,7)
- local Character = plr.Character
- Character:MoveTo(game:GetService('Workspace'):WaitForChild(mapchoose):WaitForChild('Spawns'):WaitForChild(SpawnToTeleport).Position + Vector3.new(0))
- for i = 30,0,-1 do
- wait(1)
- SideText.Value = ' Seconds until match ends'
- Countdown.Value = i
- if i == 0 then
- ToolToEquipCloned:Destroy()
- wait()
- local DefaultSpawnLocation = math.random(1,4)
- Character:MoveTo(game:GetService('Workspace'):WaitForChild('Main'):WaitForChild('Lobby'):WaitForChild('Spawnpoints'):WaitForChild(DefaultSpawnLocation).Position + Vector3.new(0))
- SideText.Value = ' Round ended'
- Countdown.Value = 0
- end
- end
- end
- end
- end
- end
- wait(1)
- game:GetService('Workspace'):WaitForChild(MapchooseName.Value).Parent = game:GetService('ServerStorage')
- SideText.Value = ' Seconds until the next match'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement