Spawn system for obby

Hello Developers,

I have used the normal spawns and disabled neutral on them all and enabled AllowTeamChangeOnTouch, for it to work do I have to have a team system running in the background, so when the player completes a stage they touch the spawn and then it changes them to that team, or am I missing something?

If you can help with any information or articles it would be much appreciated.

Many thanks,
-Veesom

1 Like

When a player touches a spawn location with a different team colour, the player’s team will change accordingly. I’m not sure what your issue is, could you provide more information?

1 Like

I need it so that when a player hits the next spawn it converts it from the previous spawn to the next spawn which the player just made contact with.

You could set the RespawnLocation of the player object to that spawn location

3 Likes

Correct me if im wrong with teamchange spawns but, don’t you need the teams folder with the separate teams in them for them to change to that team with the spawns?

1 Like

I believe so, but I don’t really want any teams in the game, I just want the spawns and then once you touch it you spawn at the spawn last touched if you die.

An example would be

local Debounce = false

SpawnLocation.Touched:Connect(function(Object)
    If not Debounce then
        Debounce = true
        if Object.Parent:FindFirstChild(“Humanoid”) then
            local Player = PlayerService:GetPlayerFromCharacter(Object)
            Player.RespawnLocation = SpawnLocation
        end
        wait(2)
        Debounce = false
    end
end)

I typed this on my phone, idk if it’s correct

1 Like

I got a working checkpoint system, I’ll post it later. It is advanced, has sensor and spawn point, and does not require teams.

2 Likes

I made a place with the system. All information is included in the game itself (Edit mode). If you have any questions regarding the system, please contact me. Hope I helped you. Here is the link to it:

5 Likes

You don’t.

On the other hand, a team system for obbies is archaic and not scalable. The practice is far antiquated and should not be used. I’d get rid of any team-based item system entirely. You should instead either use an incremental value to track the progress of a player and teleport them to a pseudospawn based on their level value, or use the RespawnLocation property as mentioned by @wevetments.

There is an Obby template straight on your Studio home screen, or accessible by the profile where the templates are held (which I have linked in this sentence). You can look at the template, break it down and salvage it for learning or usage material. This is also a topic covered in the Roblox Creator Challenge (the Jurassic Park escape game, which has checkpoints).

1 Like

Simple, use a datastore and store an int of their spawn. Make a folder called Spawns in workspace and make your checkpoints and name them 1, 2, 3, etc (depending on stage). On Touched, update the datastore / value to the parts name and on character added do Character:SetPrimaryPartCFrame(part.CFrame)

with this system and my obby, when you die, it will spawn you at the center baseplate then 3 seconds later teleport you to the spawn last at, is there a way to make it instant on respawn?

It should not do that. For me, it does not do that, and for obbys that I have helped with and used the system, that doesn’t happen. The script itself doesn’t have a 3-second delay, so I am guessing it is because of the server connection. The code that respawns the character and teleports them to the spawnpoint is this one:

Player.CharacterAdded:connect(function()
		local Character = Player.Character
		local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
		wait()
		HumanoidRootPart.CFrame = ServerScriptService:WaitForChild("PlayerSpawnData"):WaitForChild(Player.UserId).Value.CFrame + Vector3.new(0, 3, 0)
	end)

The only delay is >= 0.1 seconds, and that is because we need to wait for the character to load. It hasn’t done that to other games that I used this system in, and it should not (I even tested it with a friend that is laggy and it doesn’t do that).

1 Like

The obby is very big, I think that is the reason.

1 Like

It is probably because of server lag then. The system itself should not lag. I recommend adding a normal spawnpoint somewhere with a pad and walls, so it respawns them there and then teleports them.

1 Like