Justice, the awesome NPC system

It’s impossible to comment further without seeing your code.

-- above and outside Justice stuff
local function onRemoteTriggered(player, npcID, waitingTime)
	print(player.Name .. "'s signal was received, now triggering script for " .. npcID.Name)
	local npc = game.Workspace.NPCs:FindFirstChild(npcID.Name)
	if npc and NPCManager.NPCs[npcID.Name] and not table.find(AskingNPCs, npcID) then -- checks if NPC is in an interaction (in the table) or not
		table.insert(AskingNPCs, npcID) -- Adds NPC to a table which prevents other players from interacting with that NPC temporarily
		print("Added ".. npcID.Name .. " to the table")
		print("Script running!")
		print(player)
		print(npc)
		NPCManager.NPCs[npcID.Name](player, npcID, waitingTime) -- Main interaction scripts based in a table
	else
		print(npcID.Name.. " was not a valid NPC")
		ReceivedEvent:FireClient(player, 4) -- tell player the NPC wasn't valid
	end
end

-- at the end of startStateMachine
local brainConnect = AskedEvent.OnServerEvent:Connect(function(player, npc, gunActive, waitingTime)
	brain:Idle()
	onRemoteTriggered(player, npc, gunActive, waitingTime)
	task.wait(waitingTime)
end)

I hope this is as condensed as it can possibly be, and yes this does work without Justice.

You can just set the Humanoid Walkspeed to 0. as part of your function above. Unfortunately, the pathing will continue to calculate in the background. To kill that the setting currentPath = nil might work.

I also forgot to mention, but sometimes it errors with the script not recognizing brain:Idle whenever it ran.
Nonetheless, thank you and I will try that later.

I want to implement the same random clothing generation system of this code but for a random npc, how can I do it?

You should make them use A* pathfinding or something

could you detail a little bit more? thanks

It’s a pathfinding algorithm. There’s also dijkstra and they both work differently as you can see here.

They both have pros and cons but it depends on the use case scenario.

this is a really cool thing tyhank you for making this

Cool module! Looks optimised too.

Only thing is did you get permission to use the UGC in the module?

(Oops, didn’t mean to reply. sorry)