Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I Dont Understand How To use :MoveTo() or Click Position Can You Guys Help?

I've tried doing

local Click = game.Players.LocalPlayer:GetMouse()) do game.Workspace.Part.Position = Click

3 comments

0

Why Do My Question Always Get Closed By The Way?

0

Well thats because you are duplicating the same questions. Questions are generally answered in 1-5 hours so you have to stay patience.

0

Why did you just post another question asking the same thing? Also, that isn't valid Lua syntax.

1 answer

https://wiki.roblox.com/index.php?title=API:Class/Model/MoveTo

https://wiki.roblox.com/index.php?title=API:Class/Humanoid/MoveTo

MoveTo is used for model's PrimaryParts and Humanoid's that make them walk

Well the first thing is thats all been done wrong,

Mouse = game.Players.LocalPlayer:GetMouse() -- getting the mouse

Also to use the mouse's position use

Mouse.Hit.p --the position of the mouse

Next you want to use a Button1Down event

Mouse.Button1Down:connect(function()
	-- What you want to happen
end)

So in this case it would be

Mouse = game.Players.LocalPlayer:GetMouse()
Mouse.Button1Down:connect(function()
	game.Workspace.Part.Position = Mouse.Hit.p
end)

1 comment

0

:connect() is deprecated, use :Connect(). Seriously, I think I've posted that a good 50 times on this website.

This discussion is preserved as it was. New answers, comments, and votes are closed.