local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
local placeId = 4455580329
local loadingGui = ReplicatedStorage:FindFirstChild("LoadingGui")
-- parent the loading gui for this place
loadingGui.Parent = playerGui
-- set the loading gui for the destination place
TeleportService:SetTeleportGui(loadingGui)
-- teleport the user
script.Parent.Touched:Connect(function()
TeleportService:Teleport(placeId)
end)
Hello, this script is not working. I do not know why because its not giving me any errors. This is a local script inside of an axe mesh named "Axe". I edited a script off of https://developer.roblox.com/en-us/api-reference/function/TeleportService/Teleport and double checked it with the page information, but I'm pretty sure it should work.
Thanks for reading, Narwhal

25 comments
ok thanks ill check it out
okay let me know if you still need help
It still didn't work. I don't think there was any errors in the console still.
are you testing this on studio? because you aren't able to teleport to places on studio you have to be on the published game
No, i did it both on studio and the published game, and yes i did publish the game.
OHHHH okay i know what's wrong, is the local script inside of an axe in workspace?
I made it so the local script was in a part in workspace on top of the axe. So kinda, yeah.
you can't use local scripts in the server (workspace is the server), so you're going to have to use a script and a way to get the player from the part. I'll make another answer real quick
Kk. Thanks for the help, I've had problems with this issue before (the whole server and client thing) but I didn't know that the workspace was server based.
there i edited my answer, that should work but it looks like someone beat me to it lol
Doesn't work because playerGui needs to be defined.
there i fixed it
try it now
It didn't work .-. this has been going on for an hour now. gosh.
Heres an error i found. Workspace.AxePart.TeleScript:16: attempt to index upvalue 'loadingGui' (a nil value)
did you make a loading gui for the teleport?
because if not i edited it so you don't use it
OML ITS BECAUSE I DIDN'T PUT THE GUI IN THE REPLICATED STORAGE AND I SOME HOW DELETED IT ON ACCIDENT LMAO! that was to dramatic.
what did you name it?
OMG
there i edited it for the loading gui, hopefully it works this time
WORKS!
let me know lmao
IT WORKS YES!
YES!