Trying to make it so when you click a button on my teleport GUI, a preview of a location will pop up and the teleport button will as well, which you can then click to teleport. I'm having issues with the script. It's saying StarterGui doesn't exist in the global space ("W001: Unknown global 'StarterGui') when it definitely does. Furthermore, I am just new to scripting in general and would like to know if this would work without that error anyway, so any feedback on that would be helpful too. Thanks!
local lobbypreview = StarterGui.TeleportMenu.Frame.Preview.Lobby
local teleport = StarterGui.TeleportMenu.Telebuttoncurrent
script.Parent.MouseButton1Click:Connect(leftClick)
function leftClick
()lobbypreview.Visible = true
teleport.Visible = true
end

3 comments
Is this a LocalScript?
Yes it is
you're attempting to edit the startergui first of all, and second of all, StarterGui is not a global. To access the startergui (which you shouldnt be in your case) you'd have to do game.StarterGui