Im scripting a swordfighting game following AlvinBlox's tutorial and I made sure to follow everything exactly, but it only teleports one person when the game starts. Can someone help?

(the first line of code doesnt get marked as code idk why)

local AvailableSpawnPoints = SpawnPoints:GetChildren()

for i, player in pairs(plrs) do
	if player then 
		character = player.Character
		
		if character then
			
			character:FindFirstChild("HumanoidRootPart").CFrame = AvailableSpawnPoints[1].CFrame
			table.remove(AvailableSpawnPoints,1)
			
			local Sword = ServerStorage.Sword:Clone()
			Sword.Parent = player.Backpack
			
			local GameTag = Instance.new("BoolValue")
			GameTag.Name = "GameTag"
			GameTag.Parent = player.Character
			
		else
			
			if not player then
				table.remove(plrs,i)

1 comment

0

Do you want a random player?