I want this to move an object named "Center" when it is clicked by the mouse. Will it work? I ask because I do not have access to the studio as of right now.

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()

Mouse.Button1Down:connect(function()
    Mouse.Move:connect(function()
    	if Mouse.Target == "Center" then
          --code to move the objects model
        end
    end)
end)

4 comments

0

No, it will not, what is "Center" supposed to be?

0

Go ahead and read the answer for this question, it should help. https://scriptinghelpers.org/questions/2721/whats-the-difference-between-mousehit-mousetarget

0

you probably meant if mouse.Target.Name == "Center", which would make more sense. other than that it looks fine

0

also you don't need a move event unless you don't want to have to click each time