local mouse = game.Players.LocalPlayer:GetMouse()
local a = script.Parent.Parent.Parent
local beingclicking = false
script.Parent.MouseButton1Down:connect(function(clicked)
beingclicking = true
end)
script.Parent.MouseButton1Up:connect(function(clicked)
beingclicking = false
end)
while beingclicking == true do
print("aaaa it wurking sorta")
a.Position = Vector3.new(mouse.Hit.p.X, mouse.Hit.p.Y, mouse.Hit.p.Z)
end
This script is in a TextButton inside a surface gui on a part. This is supposed to make it so that while the mouse is being held down. However, it doesn't work at all. I know the a.Position part is probably incomplete and/or wrong, but not even the printing part works. Help please?

3 comments
Change the loop to while true do and add "if beingclickling == true then" inside the loop.
Nope, changes nothing
can you explain why you want to keep moving to mouse position while beingclicking is true?