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

Universe Teleport Service?

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.

3 comments

0

Universes are still in beta, you can't use the feature unless you're granted access.

0

By whom?

0

Oh, I have Configure This Game option.

1 answer

✓ Accepted answer

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.

1 comment

0

Thank you !

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