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

Universe Teleport Service?

Asked by 10 years ago

How would I make a teleporter when you touch it it brings you to a place in the Universe. Also another basic question. How do I make universes xD. I have this:

function onTouched(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
    game:GetService("TeleportService"):TeleportToSpawnByName(8473728, "SpawnLocation", player)
    end
end

script.Parent.Touched:connect(onTouched)

not sure on it.

0
Universes are still in beta, you can't use the feature unless you're granted access. infalliblelemon 145 — 10y
0
By whom? YellowoTide 1992 — 10y
0
Oh, I have Configure This Game option. YellowoTide 1992 — 10y

1 answer

Log in to vote
0
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
10 years ago

If you go to the universe develop page and configure the places there, you will get specific options for universes. Here is where you can add multiple places to your universe.

To teleport to places inside your universe when you touch a block, you can use this block of code:

function onTouched(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    local placeid = 1818 -- Change this number to the id of the place you want the player to be teleported to.
    local spawn = "SpawnLocation" -- Change this to the name of the spawnlocation.
    if player then
        game:GetService("TeleportService"):TeleportToSpawnByName(placeid, spawn, player)
    end
end

script.Parent.Touched:connect(onTouched)

For anymore information on the TeleportService, you can look at this guide on the Roblox Wiki.

0
Thank you ! YellowoTide 1992 — 10y
Ad

Answer this question