Ok so I have been doing lua for quite a while yet I still run into issues, is there any way I could fix this?
here is the video link to my issue: https://www.youtube.com/watch?v=xtiGcpcPlvY
here is my script: local player = game.Players.LocalPlayer local mouse = player:GetMouse() local x = mouse.X local y = mouse.Y local mtarget local down local treenames = {'AppleTree','BeginnersTree'} for _,v in pairs(treenames) do print(v) mouse.Button1Down:connect(function() if mouse.Target ~= nil and mouse.Target.Parent.Name == v then mtarget = mouse.Target.Parent print(mouse.Target.Parent.Name) down = true mouse.Move:connect(function() if down and mtarget ~= nil then mtarget:MoveTo(mouse.Hit.p,x,y) end end) mouse.Button1Up:connect(function() down = false mtarget = nil end) end end) end