Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I keep spawning at the main spawnpoint of my obby, any fixes?

I want to make stages for my obby, and on the screen I just want there to be a list of players playing and the stage they are on. Not a huge list of teams. I have tried adding obby systems in from the tool box, putting the first one called "1" at the area where I would like new players to spawn in my obby but when I test play it my player keeps falling from the sky. When I add a spawn point from the "Model" section of Roblox Studio, I spawn where I want to and when I get to the premade checkpoints from the toolbox it says I'm on that stage but when I die I return at the main spawnpoint from "model" . I've searched all over and whatever steps I follow from someone, I either end up spawning in the sky and falling into my obby, or i see the stages but when I die I go back to the main spawn. I'm very frustrated I don't know why adding stages is so hard! Anyone have any advice? I'm also a beginner scripter with not much experience.

1 answer

Players have this neat property called RespawnLocation which you can set with any SpawnLocation instance.

Make a Script and put it a SpawnLocation

local spawner = script.Parent
--Since SpawnLocations are technically parts, they have the .Touched event!
spawner.Touched:Connect(function(hit) --Assigns "hit" to the part that touched it
	local player = game.Players:GetPlayerFromCharacter(hit.Parent) --You can get a player's character from their model
	if player then --If a player touched the spawn
		player.RespawnLocation = spawner
	end
end)

An issue I can see with my script here is that if a player touches a previous checkpoint, it'll set it to that checkpoint. If that's not what you want, I can fix it. Edit:

Game.Players.PlayerAdded:Connect(function(plr)
	plr.RespawnLocation = game.Workspace:WaitForChild("PUT STAGE 1 SPAWN NAME HERE"
end)

2 comments

0

I'll try it out later, thank you.

0

I'm trying to make it so that I don't need to spawn first and then respawn, I'm talking about spawning in a specific location once you join the game if you know what I mean.

This discussion is preserved as it was. New answers, comments, and votes are closed.