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.
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.