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

Why is it not teleporting a player?

I have a multi-place game and want it so you can teleport between places. Right now I use a basic teleportation system and it doesn't work half the time and takes a lot of time when it does. Is there anything to change or to improve on?

local Teleport = game:GetService("TeleportService") 
Teleport:Teleport(ThePlaceId, plr)

This is the teleportation part of the script and the script fires when the player touches a part. The function fires and it makes a teleport GUI open on touch, but the teleportation does not work.

Any help is very useful, thanks!

1 comment

1 answer

There is a script for this by Roblox but here it is!

  1. local TeleportService =  game:GetService("TeleportService")
    
  2. local ReplicatedStorage =  game:GetService("ReplicatedStorage")
    
  3. local Players =  game:GetService("Players")
    
    
  4. local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
    
    
  5. local placeId =  0  -- replace here
    
  6. local loadingGui = ReplicatedStorage:FindFirstChild("LoadingGui")  -- replace here
    
    
  7. -- parent the loading gui for this place
    
  8. loadingGui.Parent = playerGui
    
    
  9. -- set the loading gui for the destination place
    
  10. TeleportService:SetTeleportGui(loadingGui)
    
    
  11. -- teleport the user
    
  12. TeleportService:Teleport(placeId)
    

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