How can I make the player spawn again at a certain spawn after 3 "Waves"?
Ok so the part for the map spawnpoint (player's spawnpoint) is named as "Spawn", I need help on how to make the players spawn again after a few certain waves.
01 | local roundMsg = game.ReplicatedStorage.Values:WaitForChild( "roundMsg" ) |
02 | local zombieCount = game.ReplicatedStorage.Values:WaitForChild( "zombiesRemaining" ) |
03 | local zombiesAlive = game.ReplicatedStorage.Values:WaitForChild( "zombiesAlive" ) |
04 | local gameInProgress = game.ReplicatedStorage.Values:WaitForChild( "gameInProgress" ) |
05 | local wave = game.ReplicatedStorage.Values:WaitForChild( "Wave" ) |
06 | local collectionservice = game:GetService( "CollectionService" ) |
11 | roundMsg.Value = "Intermission: " ..i |
13 | local map = math.random( 1 , 7 ) |
15 | game.ReplicatedStorage.Maps.CornFarm:Clone().Parent = workspace.Map |
18 | game.ReplicatedStorage.Maps.Subway:Clone().Parent = workspace.Map |
20 | for i, v in pairs (workspace.Map:FindFirstChildOfClass( "Model" ):GetChildren()) do |
21 | if v.Name = = "Spawner" then |
22 | collectionservice:AddTag(v, "Spawner" ) |
25 | for i, v in pairs (game.Players:GetPlayers()) do |
26 | collectionservice:AddTag(v.Character, "Alive" ) |
27 | v.Character.Torso.CFrame = workspace.Map:FindFirstChildOfClass( "Model" ).Spawn.CFrame |
29 | roundMsg.Value = "Round in Progress" |
31 | zombiesAlive.Value = 6 |
33 | gameInProgress.Value = true |
35 | if #collectionservice:GetTagged( "Alive" ) > 0 then |
36 | if zombiesAlive.Value = = 0 then |
37 | wave.Value = wave.Value + 1 |
38 | zombieCount.Value = 6 * wave.Value |
39 | zombiesAlive.Value = 6 * wave.Value |
41 | elseif #collectionservice:GetTagged( "Alive" ) = = 0 then |
42 | gameInProgress.Value = false |
45 | until gameInProgress.Value = = false |
46 | workspace.Map:ClearAllChildren() |
Alright so here is the main script for my game so far but I'm having trouble on how to make the players spawn again after a few certain waves