#How do I make this dummy move??

3 messages · Page 1 of 1 (latest)

sacred nexus
#
local runService = game:GetService("RunService")

local p1 = workspace.Part1
local p2 = workspace.Part2

local character = script.Parent  

local function moveToPosition(position)
    local humanoid = character:FindFirstChild("Humanoid")
    if humanoid then
        humanoid:MoveTo(position)
    end
end

local isMovingToP1 = true  -- Variable to keep track of which position to move to initially

runService.RenderStepped:Connect(function()
    if isMovingToP1 then
        moveToPosition(p1.Position)
    else
        moveToPosition(p2.Position)
    end
end)

    wait(1)
    isMovingToP1 = not isMovingToP1
end
#

Ofc you may need to change hierarchy and such, but here you go. I'm way too tired to attempt to explain and help you through it, so I'll just spoonfeed you as much as I hate spoonfeeding.

amber anchor
#

I personally use a repeat, until loop and use the movetofinished:wait(), think is what that method is called