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

Script that makes it possible to teleport to last touched checkpoint? (OBBY)

Basically, I am having touble with having a system like Mega Fun Obby. When you touch a brick or fall, you teleport straight back to your last touched checkpoint and don't ever die or lose health. Any help to allow me to teleport back to the most recently touched checkpoint on touch or when falling would be appreciated.

2 comments

0

Ummmm, Can you please format this ALL into Lua so it's more easy to read? Thanks if you could

0

this code looks free modeled. So im not gonna help with this. I used this code when I was starting out coding but its 100% free modeled the leaderboard script that is

2 answers

✓ Accepted answer

What I do is look for the player's leaderstats stage number and find the stage number in the workspace and teleport them to the stage. Here what the code should look like:

game.Players.PlayerAdded:Connect(function(Player)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = Player
	
	local Stage = Instance.new("NumberValue")
	Stage.Name = "Stage"
	Stage.Value = 0
	Stage.Parent = leaderstats
	
	Player.CharacterAdded:Connect(function(Character)
		Character.HumanoidRootPart.CFrame = game.Workspace:FindFirstChild(tostring(Stage.Value)).CFrame -- Assuming you have done the leaderstats of the player and the stages are in workspace only	
	end)
end)

Hope this helps! If it did, remember to accept! If there is an error report it and I will try my best to fix it asap!

Hi there! It's not a script, but I know a solution. Create a spawnpoint where every checkpoint is then make teams for each checkpoint, like "Team 1, Team 2, Etc." Next, enable the "change team on touch" on every spawn point and that should work! If you don't understand spawn points, here you go! https://developer.roblox.com/en-us/api-reference/class/SpawnLocation

Hope it helps!

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