Justice, the awesome NPC system

Literally dragging in the rbxm file into Studio, not the NPC model itself. Sorry, could’ve worded that better.

1 Like

I assume you meant AreOwnersShown.

image
I’m not experiencing the issues you have. Try having the model be in the workspace by default, and add a script which just has this code running:

for i,v in next, workspace.Dummy:GetDescendants() do if v:IsA('BasePart') then v:SetNetworkOwner(nil) end end

Yeah, tried that with same effect. Have you tried sticking a hat or something on it? I have a feeling it’s related to attachments.

I think I need to ask to split this topic. :stuck_out_tongue:

image
this definitely seems like an issue on your side currently. Can’t reproduce your issue whatsoever.

Phenomenal job! :star: One thing I would recommend: turn this into a plugin and enable customization with user-friendly UI etc. as well as the ability to set the path for just 1 NPC which plays whenever a function in the ModuleScript is called. If you need any help on the UI, check my portfolio! I would be more than willing to help!

…you ever just try something and realize that you should probably rethink your career?

Hey, fun fact! :AddAccessory ignores the current network owner and resets it to auto, so you have to call SetNetworkOwner after you add your accessories! I should’ve thought about that before!

I’ll add a fix for that now. I need more caffeine it seems.

2 Likes

I keep getting this error after the NPCs spawn. I’m probably doing something wrong but can you tell me what?

Workspace.Justice:32: invalid argument #2 to ‘random’ (interval is empty) - Server - Justice:32
14:52:29.792 Stack Begin - Studio
14:52:29.792 Script ‘Workspace.Justice’, Line 32 - function getRandom - Studio - Justice:32
14:52:29.793 Script ‘Workspace.Justice’, Line 71 - Studio - Justice:71
14:52:29.793 Stack End

Thank you! I was thinking about making a plugin for it at some point, I’ll keep it in mind. Thanks for the offer!

Individual pathing with setting waypoints was on the roadmap for if I turned it into a plugin. It’s a while ahead but it’ll most likely be a thing before a full release.

2 Likes

Definitely interesting. No worries, this would’ve taken me some brainstorming to figure out too - you did the brunt of the job here, finding out that :AddAccessory updates network ownership. I’d assume what’s going on is since accessories have their network ownership set to Auto, it would cause conflicts to have both Auto and nil network owners in the assembly, so thus Roblox stitches the issue by changing the network ownership of the whole assembly to Auto.

1 Like

Ah, that’s a known bug. You’re probably blanking out a required asset table which is completely my fault since I’m forgetting to check if they’re empty. FWIW, faces and clothes are required. For hair and accessories, just set all = { nil } and have the other tables for your discriminators blank. If you don’t need them at all, you can just comment out lines 162 to 170 (if I remember correctly).

1 Like

Seems logical. I should probably file a request to have this topic split now since we did clutter this up quite a bit. :laughing:

1 Like

Build 2

  • Implements FastWait by MaximumADHD / CloneTrooper1019
  • Fixes that pesky network ownership bug

Download it from the main post. Historical builds are available under History.

I took a look through the script and it looks like “CollectionService” has something to do with it. I don’t know what to do with that though.

Would it be possible for them to sit and hold tools? if so I may make a Robot cabin crew system for my airline

I think I need to use tag editor.

I recommend Tag Editor since it’ll make your life a lot easier. You need to tag areas you want the NPCs to walk on as pathfindable. Weird name in retrospect I’ll most likely change it in an upcoming build. But for now, that’s what you need to tag your floors as.

For now, sitting and holding tools isn’t a thing that is supported. I tried to get sitting working earlier but due to the way Roblox does navmeshes it doesn’t work correctly. I’ll see if I can come up with a solution however. For the tools, not sure if that will ever be supported. That’s something you’d have to add yourself in an extension to the script.

1 Like

thanks, it is working now. :slight_smile:

1 Like

Looks great! This can help me learn in scripting npc! I will definently use in my game!

Build 3

  • Logging from the NPC controllers can now be disabled in the configuration
  • The origin point of your NPCs can now be changed
  • NPC generation now yields after each NPC spawned to prevent execution timeout or game hangs

Download it from the main post. Historical builds are available under History .

1 Like