Why self isn't worked when I tried get HumanoidRootPart or another parts?

are you sure that your model called ‘John Doe’ has instance called ‘HumanoidRootPart’ in it?

maybe it just returns nil.

Yes, HumanoidRootPart does exist.

self.brutez must be nil then. I am not really able to read the code entirely at the moment.

Why can’t you read my code? I sent the whole code.

But by the way, my codes with the same definition of self works.

Found the issue.

local BrutezAI = require(script.Parent:WaitForChild("ModuleScript"))
local brutezScript = script
local brutezAI = BrutezAI.new(brutezScript.Parent)

while true do

	local nearestTarget = brutezAI:FindNearestTarget()
	if nearestTarget then
		brutezAI:navigateToTarget(nearestTarget)
	end

	brutezAI:checkOpenDoor()

	wait()
end

Try this Script instead.
After looking at the code, I realized you used the method navigateToTarget on BrutezAI and not brutezAI, which is the general module and not the object, which yielded the error.

I’m grateful you!!!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.