local pathfindingService = game:GetService(“PathfindingService”)
local humanoid = script.Parent.Humanoid
local body = script.Parent:FindFirstChild(“HumanoidRootPart”) or script.Parent:FindFirstChild(“Torso”)
local destination = game.Workspace.endingPart.Position
local path = pathfindingService:CreatePath()
path:ComputeAsync(body.Position, destination)
local Waypoints = path:GetWaypoints()
for _, Waypoint in pairs(Waypoints) do
if Waypoint.Action == Enum.PathWaypointAction.Jump then
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
else
local Part = Instance.new(“Part”)
Part.Shape = “Ball”
Part.Size = Vector3.new(5,5,5)
Part.Parent = game.Workspace
Part.Anchored = true
Part.CanCollide = false
Part.Transparency = 0
local TouchingParts = Part:GetTouchingParts()
local function ClimbTruss(Truss)
if Truss then
humanoid:MoveTo(Truss.Position + Vector3.new(0,0,0))
humanoid.MoveToFinished:Wait()
end
end
for _, v in pairs(TouchingParts) do
if v:IsA(“TrussPart”) then
ClimbTruss(v)
Part:Destroy()
break
end
end
end
humanoid:MoveTo(Waypoint.Position)
humanoid.MoveToFinished:Wait()
end
I didn’t make the script. I just mashed up two different scripts into one. I don’t know what I was doing I was just expecting something to happen.