What do you want to achieve? I would like to create a GUI that whenever you click it, it would take you to another place in my game.
What is the issue? The script I use just wont work and I dont get why
What solutions have you tried so far? I spent around an hour looking for solutions but couldnt find any
local TeleportService = game:GetService("TeleportService")
Plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
TeleportService:Teleport(7618728961, Plr)
end)
1 Like
7z99
(cody)
October 1, 2021, 11:00pm
#2
Any chance you’re doing it in studio? Teleports don’t work in studio.
No, I am making sure I do it in the actual game.
7z99
(cody)
October 1, 2021, 11:05pm
#4
Gotcha. Are you waiting a minute before you teleport? Teleporting to another place isn’t instantaneous, especially if there aren’t any existing servers.
Also any output errors?
I just tested it, it said “Invalid player to teleport”
7z99
(cody)
October 1, 2021, 11:09pm
#6
Ah okay, are you using a server script? If so, you should switch to a localscript as players.LocalPlayer doesn’t exist on the server.
Sorry I am a little confused on what you are saying. It is in a non local script so you want me to change to a local script?
7z99
(cody)
October 1, 2021, 11:11pm
#8
Yeah, switch to a localscript. The LocalPlayer property of the Players service doesn’t exist on the server.
Thank you so much! Your a life saver!
1 Like