So my enemy code works fine, the enemy will chase the player when in sight and range and will start attacking the enemy when within attack range. So in the attack range code I decided to add a block of code so that when they first enter combat with a player they will have a random chance to start blocking first and if they do I want the enemy to start moving left or right a random amount of studs. However the code run fine and it does print either “move left” or “move right” but the :MoveTo() line seems to fire but the enemy just doesn’t actually move left or right? I am unsure why that is.
enemy.Bindables.Block:Fire("Begin")
if (math.random(0, 1) == 0) then
print("Move right")
enemyHumanoid:MoveTo(enemyHumanoidRootPart.CFrame * CFrame.new(math.random(5, 10), 0, 0).Position)
enemyHumanoid.MoveToFinished:Wait()
else
print("Move left")
enemyHumanoid:MoveTo(enemyHumanoidRootPart.CFrame * CFrame.new(math.random(-10, -5), 0, 0).Position)
enemyHumanoid.MoveToFinished:Wait()
end
enemy.Bindables.Block:Fire("End")