Hi There!
Before you can think of doing this, you need to know about the following:
TeleportService
And
Teleport
Now, we can get to the scripting part.
MAKE SURE YOU ENABLE 3RD PARTY TELEPORT SERVICE INSIDE OF SECURITY!!
So first, you can only teleport players to another Experience you own.
Place the following script in ServerScriptService:
01 | local TeleportService = game:GetService( "TeleportService" ) |
02 | local AllowedUsersToTeleport = { game.CreatorId, "" } |
04 | local TARGET_PLACE_ID = 1818 |
06 | game.Players.PlayerAdded:Connect( function (player) |
07 | for i,v in pairs (AllowedUsersToTeleport) do |
08 | if player.Name = = v or player.UserId = = v then |
09 | player.Chatted:Connect( function (message) |
10 | local Text = "Your message here" |
11 | if message = = Text then |
12 | TeleportService:TeleportAsync(TARGET_PLACE_ID, player) |