local PathFindingService = game:GetService("PathfindingService")
local npc = script.Parent
local hum = npc:WaitForChild("Humanoid")
local path = PathFindingService:CreatePath({
AgentCanJump = true,
AgentCanClimb = true,
WaypointSpacing = 4,
AgentRadius = 4,
Costs = {
Wood = 2,
Neon = 100,
DangerZone = 10,
Door1 = 10,
Door2 = 5
}
})
local GoalPart = workspace:WaitForChild("GoalPart")
local success,errormessage = pcall(function()
path:ComputeAsync(npc.PrimaryPart.Position,GoalPart.Position)
end)
if success and path.Status == Enum.PathStatus.Success then
for _,waypoint in pairs(path:GetWaypoints()) do
local part = Instance.new("Part")
part.Material = "Neon"
part.Anchored = true
part.CanCollide = false
part.Shape = "Ball"
part.Position = waypoint.Position
part.Parent = workspace
hum:MoveTo(waypoint.Position)
if waypoint.Action == Enum.PathWaypointAction.Jump then
hum.Jump = true
end
hum.MoveToFinished:Wait()
end
else
warn(errormessage)
end
The character completely stops and it prints nil into the output saying there is no error. IF THERE IS NO ERROR MOVE DAMN IT! When I remove the door1 and door2 costs it works all of a sudden but when I add it back it refuses to work, yes I move the part and player to the correct spot making sure the doors are not collidable allowing the rig to go through it to the part.
https://medal.tv/games/roblox-studio/clips/kxloDXqXV54V055Nb?invite=cr-MSxUMlMsMTg3ODQwNTU3
Watch Untitled by TheRussianMafia and millions of other Roblox Studio videos on Medal. Tags: Roblox Studio