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.
local roundMsg = game.ReplicatedStorage.Values:WaitForChild("roundMsg") local zombieCount = game.ReplicatedStorage.Values:WaitForChild("zombiesRemaining") local zombiesAlive = game.ReplicatedStorage.Values:WaitForChild("zombiesAlive") local gameInProgress = game.ReplicatedStorage.Values:WaitForChild("gameInProgress") local wave = game.ReplicatedStorage.Values:WaitForChild("Wave") local collectionservice = game:GetService("CollectionService") while true do for i = 10,0,-1 do roundMsg.Value = "Intermission: "..i if i == 1 then local map = math.random(1,7) if map == 1 then game.ReplicatedStorage.Maps.CornFarm:Clone().Parent = workspace.Map end if map == 2 then game.ReplicatedStorage.Maps.Subway:Clone().Parent = workspace.Map end for i, v in pairs(workspace.Map:FindFirstChildOfClass("Model"):GetChildren()) do if v.Name == "Spawner" then collectionservice:AddTag(v, "Spawner") end end for i, v in pairs(game.Players:GetPlayers()) do collectionservice:AddTag(v.Character, "Alive") v.Character.Torso.CFrame = workspace.Map:FindFirstChildOfClass("Model").Spawn.CFrame end roundMsg.Value = "Round in Progress" zombieCount.Value = 6 zombiesAlive.Value = 6 wave.Value = 1 gameInProgress.Value = true repeat if #collectionservice:GetTagged("Alive") > 0 then if zombiesAlive.Value == 0 then wave.Value = wave.Value + 1 zombieCount.Value = 6 * wave.Value zombiesAlive.Value = 6 * wave.Value end elseif #collectionservice:GetTagged("Alive") == 0 then gameInProgress.Value = false end wait(1) until gameInProgress.Value == false workspace.Map:ClearAllChildren() end wait(1) end end
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
Running off the top of my head you'll want to make use of two things. 1. You'll want to disable the CharacterAutoLoads feature found under every player. A quick example being:
game:GetService("Players").PlayerAdded:Connect(function(plr) plr.CharacterAutoLoads = false end)
And 2. You'll want to use the Player:LoadCharacter() feature which does what it says on the tin. So for each player that isn't currently alive you can use LoadCharacter on them after the respawn requirements you want to set in place are met.