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

How would I Make a Teleporter For an Obby ?

So that if the Player walks over it then they Teleport there.

Also I can't find a Good Rbx Lua Tutorial Site

function onTouched(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
	game:GetService("TeleportService"):TeleportToSpawnByName("SpawnLocation1", player)
    end
end
 
script.Parent.Touched:connect(onTouched)

This is the Code ..

I want to have many different teleport to different areas .

1 comment

0

This is not a request site, please show us your attempt at the script.

2 answers

✓ Accepted answer

You can do this without scripting. (just like 2011!)

Put down a team spawn

go into settings and make: team change on touch

Bam! when a player steps on it they will spawn there!

I hope this helps.

Use :MoveTo. TeleportService is to teleport to DIFFERENT GAMES.

Use a LocalScript for this one...

player = game.Players.LocalPlayer
Part = Workspace.SpawnLocation1

script.Parent.Touched:connect(function
player:MoveTo(Part.Position, Part) --Moves the player to "Part"s Position
end)

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