How would I loop this AI Script

Hello, I’m currently working on this SCP Game and I’m trying to make a passive AI currently the script works but I want it to move from Destination1 to Destination2 every 15 seconds. I currently just added a wait statement then copied and paste the code and changed it to Destination 1 but that won’t work because I have a line of code limit.

local pathfindingService = game:GetService(“PathfindingService”)

local humanoid = script.Parent.Humanoid
local body = script.Parent:FindFirstChild("HumanoidRootPart") or script.Parent:FindFirstChild("Torse")
local Destination1 = game.Workspace.Destination1.Position

local path = pathfindingService:CreatePath()

path:ComputeAsync(body.Position, Destination1)

local waypoint = path:GetWaypoints()

for k, waypoint in pairs(waypoint) do

	if waypoint.Action == Enum.PathWaypointAction.Jump then


Can you please use the code block formatting? Reading you post is impossible.

Where would I find that when I go to edit that?

Search up markdown code block and you’ll see.

Edit: you did it