Hello fellow developers ! So , I don’t know why but the spawn points in my game are actually not working how they should. I want that when the player dies , they spawn back into the lobby and not in the map in which they just died but due to some reason they spawn in the same map again. I am not able to solve the issue since 3 days. Here is my spawning code.
-- Teleport players to the map
wait(5)
local SpawnPoints = ClonedMap:FindFirstChild("SpawnPoints")
if not SpawnPoints then
print("Spawnpoints not found!")
end
local AvailableSpawnPoints = SpawnPoints:GetChildren()
for i, player in pairs(plrs) do
if player then
character = player.Character
if character then
-- Teleport them
character:FindFirstChild("HumanoidRootPart").CFrame = AvailableSpawnPoints[1].CFrame + Vector3.new(0,10,0)
table.remove(AvailableSpawnPoints,1)
Any help will be really appreciated. If it is required then I am using R15 avatar type.