teleport = game.Workspace.teleport function MoveTo() game.Players.LocalPlayer.Character:MoveTo(teleport) script.Parent.MouseButton1Down:connect(MoveTo)
this is in a regular script not local
First of all you can't can't use Local Player in a regular script, second of all your not using position or CFrame..
First of all put this in a local script. Put the following inside StarterGui in order.
SCREENGUI
FRAME
TextButton
SCRIPT
local player = script.Parent.Parent.Parent.Parent Workspace = game:GetService('Workspace') script.Parent.MouseButton1Down:connect(function() player.Character.Humanoid:MoveTo(Workspace.teleport.Position,Workspace.teleport) end)
That should work once you put it in a local script, mk. For this to work you have to make sure 'teleport' actually exists also.
If this helped +1, if this answered your question check mark.
You've made the mistake that I've made dozens of times when working with properties and Values. You define "teleport" at the beginning as a Part
inside the Workspace, and then tell the script to move the character to the brick itself. MoveTo()
needs a Vector3 value, so you have to write MoveTo(teleport.Position) for it to send the player to the Position where said brick is.
teleport = game.Workspace.teleport function MoveTo() game.Players.LocalPlayer.Character:MoveTo(teleport.position) end script.Parent.MouseButton1Down:connect(MoveTo)
Simple solution, You forgot an end and that moving models relies on a position and not a part.