I built a teleport script but I get an error saying player not found when playing In game. This works in the workspace however.
player = game.Players.LocalPlayer script.Parent.MouseButton1Down:connect(function() game:GetService("TeleportService"):Teleport(334747890, player) end)
I get 0 player console errors.
Assuming this is in a GUI, you simply need to change this Script into a LocalScript for it to work, as LocalScripts will run inside a Player's PlayerGui.
player = script.Parent.Parent.Parent.Parent.Parent script.Parent.MouseButton1Down:connect(function() game:GetService("TeleportService"):Teleport(334747890, player) end)
Let me know if this worked? Ty.