So, I'm not gonna lie, this code is from a free model. Nonetheless, it doesn't work. I have a button that; when you click it; **** should **** teleport you to a different map. But it doesn't. here is the code:
script.Parent.MouseButton1Click:connect(function() --what fires all the code
local place = script:FindFirstChild("PlaceId")
local spawn = script:FindFirstChild("DestinationSpawnName")
local placeId
local spawnName
if place then
placeId = place.Value
if spawn and spawn.Value then
spawnName = spawn.Value
game:GetService("TeleportService"):TeleportToSpawnByName(placeId, spawnName)
else
game:GetService("TeleportService"):Teleport(placeId)
end
end
end)
if anyone can help me, it would be much appreciated.
the int valie "DestinationSpawnName" and "PlaceId" are put into the local script. This local script is put into the button.

2 comments
Try placeId = {} and spawnName = {} no idea if that'd work tbh
doesn't work