local TeleportService = game:GetService("TeleportService")
local id = 364386074
local button = game.Workspace.LocationHologram.Hologram.SurfaceGui.ImageButton
function onClicked()
TeleportService:Teleport(id)
end
button.MouseButton1Click:connect(onClicked)
This LocalScript only seems to work in PlaySolo, and not the actual server. I figured it was because it wasn't supposed to be a LocalScript. So, I tried this script using a ServerScript and rerouted the button variable but it still didn't work. Does anyone know why?

3 comments
Are you using Filtering Enabled?
Make it a ServerScript.
No, I'm not using FilteringEnabled. And also, I've tried using a ServerScript as I said in the post. But it still didn't work.