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

place to place teleporter

Asked by 11 years ago

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

Log in to vote
3
Answered by
ultrabug 306 Moderation Voter
11 years ago

Use the teleport service then. Example:

1ts=game:GetService("TeleportService")
2game.Workspace.Part.Touched:connect(function(hit)
3    if hit.Parent and hit.Parent.Humanoid then
4        ts:Teleport(5837573, game.Players:GetPlayerFromCharacter(hit.Parent))--the number is the id of the place.
5    end
6end)
Ad
Log in to vote
0
Answered by
Kratos232 105
11 years ago

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.

01PlaceId = 000000
02Part = script.Parent
03Players = Game:GetService("Players")
04 
05Part.Touched:connect(function(Hit)
06Player = Players:GetPlayerFromCharacter(Hit.Parent)
07if Player then
08Game:GetService("TeleportService"):Teleport(PlaceId, Player.Character)
09end
10end)

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
Log in to vote
-1
Answered by 11 years ago

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

1ts=game:GetService("TeleportService")
2game.Workspace.Part.Touched:connect(function(hit)
3    if hit.Parent and hit.Parent.Humanoid then
4        ts:Teleport(5837573, game.Players:GetPlayerFromCharacter(hit.Parent))--the number is the id of the place.
5    end
6end)
0
BTW Don't Forget That Was A Example Or It Might Not Work Loriese 0 — 11y

Answer this question