Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I Make a Teleporter For an Obby ?

Asked by 9 years ago

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 .

0
This is not a request site, please show us your attempt at the script. M39a9am3R 3210 — 9y

2 answers

Log in to vote
0
Answered by 9 years ago

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.

Ad
Log in to vote
0
Answered by 9 years ago

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)

Answer this question