Hey! I’m trying to get a TP Gui working so you can TP to the different areas of my game. It’s bubblegum sim-esque, so the different areas are stacked on top of each other in the sky and you work your way up.
I have this working, but it only works on the 1st and 2nd level. Once you get to the 3rd and beyond it no longer works.
Here’s a video showing this:
https://i.imgur.com/5MOEzBJ.mp4
The code
I have 6 layers. The TP Parts, 1-6, are all in a folder (Workspace.TeleportParts.TeleportPart#)
This code is in the main GUI Script I have that encompasses all my gui (StarterGui>Main>GUIScript)
--I cut out the code for the visuals so this is just the TP portion
layer1Button.MouseButton1Click:Connect(function()
local player = game:GetService("Players").LocalPlayer
local character = player.Character
character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(teleportPart1.Position)
end)
--I just copy and paste this for each button in the TP Menu. I'm sure that's not the most efficient way to do it but it's how I got it to work lol
Right now the areas are all straight copies of each other so they should all work properly if the first one does. I did double check the teleport part anyway though and it was in the right place. Could there be a problem if the part is out of render distance or something? The 3rd layer is at y3000+.
Thanks!