Player not spawning at correct spawn location even when explicitly told to

The player is not spawning in the correct spawn location, EX. respawn location is set to spawn location 1 but I spawn at spawn location 2. I have a print statement that shows where the player should respawn, print("Respawn location set to:", player.RespawnLocation.Name, "for", player.Name)

This code actually works and prints “Respawn location set to: Lvl 1 Spawn Location for EffBeeCee” but when I reset my character I just end up respawning at a random spawn location under team 1.

Any help is appreciated!

5 Likes

what i would do is create invisible parts that you want people to spawn at, and add a black box underneath your map where unspawned players are held
after that teleport the players in the black box depending on what spawn they’re tied to

i dont really know what your game is about but you could create a string or int value stored in the player which determines which spawn they’re currently supposed to spawn at

3 Likes

The game is an obby and my respawn point is already a working system. I should be spawning at all the correct points but roblox is overriding my script and just spawning me at a random spawn location, not the set respawn location.

Can you show the code where you actually set the player’s respawn location?

Why are you using respawn location?

Because if I don’t I will just be sent to a random spawn location in the team (I don’t want like 30 teams)

Levels is a table with all of the spawn locations

local function fixSpawnLoc(spawnNum)
	
	local oldSpawn
	
	if spawnNum ~= 1 then
		oldSpawn = levels[spawnNum-1]
	else
		oldSpawn = nil
	end
	
	local currentSpawn = levels[spawnNum]
	
	if debounce == false then
		debounce = true
		
		player.RespawnLocation = currentSpawn
		
		print("Respawn location set to:", player.RespawnLocation.Name, " for ", player.Name)
		
		wait(3)
		
		debounce = false
	end
end

levels[1].Touched:Connect(function(hitPart)
	fixSpawnLoc(1)
end)
1 Like

You can Neutral to false and turn on AllowTeamChanging to true and change the team color of that respawn location.

Make sure the Pad you are trying to teleport to has the Neutral property and has the same TeamColor as ur TeamColor

The point of the script is so I don’t have to use many teams and I can just use 1 for multiple spawn locations

It won’t create a new team, it will create a fake temp team. Also, why not make a custom checkpoint system? I made one awhile ago if that’s what you need

I am trying to make a custom checkpoint system, also when I changed the team colors to random colors on the spawn locations it would place me on the “neutral team” and I want a lobby team and a stage 1 team

I know this may sound silly, but is the location you’re trying to set, actually a SpawnLocation or a part?

No clue why you want teams at all, they look nasty. That is why most obbies now have no teams!

It’s a spawn location

charcharcharchar

This is very true, reasons like this are why many modern obbies have moved away from teams.

its just 2 teams… (stages in my obby are going to have many levels in them)

Still, why have teams? It still makes it ugly.

Because I want to have teams… idk

then steer away from Spawnlocations, make a part which stands for the spawn then just teleport the character to the new spawnpoint every time they spawn

1 Like