Ive been trying to make a game and it involves npcs moving to the press of my mouse now i already know the location of my mouse as i put this is starterpack local LocalPlayer = game.Players.LocalPlayer local mouse = LocalPlayer:GetMouse() mouse.KeyDown:Connect(function(key) print(key) end) mouse.Button1Down:Connect(function() print(tostring(mouse.Target.Name)..""..tostring(mouse.Hit.Position)) end) but i dont know how to use the location of the press to move the npc to that location can anyone help me?
COMMUNITY QUESTION
How to make a npc move to your cursors location?
1 answer
This is on a localscript which means it will not show up for other people. Try using a regular script inside of the tool and firing a remoteevent to a localscript which would return a remote event to the script with the mouse.hit.p attatched. also, use Humanoid:MoveTo()
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
please format your code. you can do this by selecting your code, then pressing the "lua" icon
you can use the
Humanoid:MoveTofunction to move any character to a location. for more information go to the api reference