basically i need a move part loop that would go in the target position repetivelly, and easy to set up just by adding a vector3 attribute in the object.
if des:GetAttribute("SlowMove") then
task.spawn(function()
while true do
wait(1)
local originalpos = des.Position
local target = des:GetAttribute("SlowMove")
local success,errorm = pcall(function()
TweenService:Create(des,TweenInfo.new(1),{Position = target}):Play()
end)
if not success then
warn(errorm)
end
des:SetAttribute("SlowMove",originalpos)
wait(1.1)
end
end)
end
However it doesn’t show any kind of errors with my pcall function. and the loop is working (testing with print)
task.spawn(function()
while true do
wait(1)
print("loop running")
local originalpos = des.Position
local target = des:GetAttribute("SlowMove")
local success,errorm = pcall(function()
TweenService:Create(des,TweenInfo.new(1),{Position = target}):Play()
end)
if not success then
warn(errorm)
end
des:SetAttribute("SlowMove",originalpos)
wait(1.1)
end
end)