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 10 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
10 years ago

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)
Ad
Log in to vote
0
Answered by
Kratos232 105
10 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.

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

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)
0
BTW Don't Forget That Was A Example Or It Might Not Work Loriese 0 — 10y

Answer this question