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

How to make an checkpoint system for an obby?

So basically i have a couple stages of an obby and i want to have checkpoints. Everywhere online it tells me to allow team change on touch etc. For some reason it doesn't work for me and i feel like even if its done it will spawn me in one of the many spawnblocks so i personally think its unreliable.

Currently i want to know whether i can manipulate the spawnlocation specifically which looks something like this:

player.SpawnLocation=currentStage(changed though touching a block)

I have another question, how would write a statement which says "if in contact with 3rd party object"

Apologiese for the terrible explanation Thank you!

2 comments

0

Im trying to make a small obby game by today and cant test if i teleport to random areas of the map

1

player Objects have a property called 'RespawnLocation,' which determines what Spawn location the player will spawn at

1 answer

✓ Accepted answer

The player object has a property called RespawnLocation. This property allows you to manipulate the spawn location of the player.

Insert a script into your spawnlocation with this code:

script.Parent.Touched:Connect(function(Hit)
	if Hit.Parent:FindFirstChild("Humanoid") then -- checking if the hit is a player
		local char = Hit.Parent
		local player = game.Players:GetPlayerFromCharacter(char) -- getting player 
		if player then 
			player.RespawnLocation = script.Parent
		end
	end
end)

As for your second question, you can also use .Touched to detect if the player is in contact with X object.

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