I tried making this script to teleport the player to a different place in the game: every time i press it it says invalid player to teleport (it says this in the output section) PLS HELP
local TeleoprtService = game:GetService("TeleportService")
local place = 6559431690
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
TeleoprtService:Teleport(place, player)
end)

3 comments
I fixed the error thankfully but when I press the button it still isnt doing anything. I am trying it from the actual game since you cant tp in roblox studio so I am unable to see any errors.
Press F9 to open the dev console or type "/console" in the chat. Essentially, it's an in-game output that shows both the logs of both the server and client. While you're at it, what is the parent of the script? Is it in a button that's in a screengui, or in a surfacegui on a part?
The button is a screengui and it is working now but when I teleport there a message pops up that says I do not have access to the place I am trying to teleport to, but it keeps me there anyways.