Paste this code under your bot in a script.
local PathfindingService = game:GetService("PathfindingService")
local Path = PathfindingService:CreatePath({
AgentRadius = 3,
AgentHeight = 6,
AgentCanJump = true,
Costs = {
Water = 20
}
})
while task.wait(1) do
for i,Player in pairs(game:GetService("Players"):GetPlayers()) do
Path:ComputeAsync(script.Parent.UpperTorso.Position,Player.Character:FindFirstChild("HumanoidRootPart").Position)
local Waypoints = Path:GetWaypoints()
for i,waypoint in pairs(Waypoints) do
if waypoint.Action == Enum.HumanoidStateType.Jumping then
script.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
script.Parent.Humanoid:MoveTo(waypoint.Position)
script.Parent.Humanoid.MoveToFinished:Wait()
end
script.Parent.Humanoid:MoveTo(Player.Character:FindFirstChild("HumanoidRootPart").Position)
end
end
Just want to help the ones who don’t understand PFS properly. Modify the above code as your desire and if there are any errors regarding Character being nil, put this line just after the for loop.
local Character = Player.CharacterAdded:Wait() or Player.Character
This will make the script wait until your avatar is fully loaded.
Goodluck!
Here is the output with raw code: