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

place to place teleporter

i want to make a roblox mall that would teleport you to other places when you walk into the store so if you walk in a store within the mall it teleports you to a place like kestral store like in the winter games lobby

3 answers

✓ Accepted answer

Use the teleport service then. Example:

ts=game:GetService("TeleportService")
game.Workspace.Part.Touched:connect(function(hit)
	if hit.Parent and hit.Parent.Humanoid then
		ts:Teleport(5837573, game.Players:GetPlayerFromCharacter(hit.Parent))--the number is the id of the place.
	end
end)

To do this you need to use the TeleportService. Here's a script for it. Put this script into the PART that you want to teleport you to the place. Note: You need to change the PlaceId yourself.

PlaceId = 000000
Part = script.Parent
Players = Game:GetService("Players")

Part.Touched:connect(function(Hit)
Player = Players:GetPlayerFromCharacter(Hit.Parent)
if Player then
Game:GetService("TeleportService"):Teleport(PlaceId, Player.Character)
end
end)

Well, if you add this script inside the part and change the PlaceId to the PlaceId of the game you want them to go to, it should work.

  • Kratos232

Example: To Use It Insert A Teleportal to a game/place

ts=game:GetService("TeleportService")
game.Workspace.Part.Touched:connect(function(hit)
    if hit.Parent and hit.Parent.Humanoid then
        ts:Teleport(5837573, game.Players:GetPlayerFromCharacter(hit.Parent))--the number is the id of the place.
    end
end)

1 comment

0

BTW Don't Forget That Was A Example Or It Might Not Work

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