Hi! So I wanted to make a button, and if I click it, it will teleport me to a place. Here is the script
script.Parent.MouseButton1Down:Connect(function()
local tp = game:GetService("TeleportService")
local player = game.Players.LocalPlayer
tp:Teleport(8716942321, player)
end)
But everytime I click on it, I get teleported, but to an empty place. The placeId I set there wasn’t an empty place, and I get this error in the Client output :
–PlaceLauncher: Teleport failed because join script failed to load
I checked it, and there is no error on the server output.
I checked devhub for an errorcode, I think it’s either 516 or 611, or 610, because there is no error code, more like a custom one. I searched the whole internet, but nothing. I tried to change the MouseButton1Up to Down, nothing.
It seems that your script is working, but you’re being teleported to the wrong place.
Be sure to double-check your destination’s PlaceId. You can open your assets menu and copy the PlaceId of the place you want the player to teleport to.
If it doesn’t seem to work, try out this script:
local TeleportService = game:GetService("TeleportService")
local player = game.Players.LocalPlayer
local debounce = false
local placeId = 8716942321
script.Parent.MouseButton1Click:Connect(function()
if debounce == true then return end
debounce = true
TeleportService:Teleport(placeId, player)
end)