NPCs spawned on the client cannot equip tools, anyone encountered this issue before?

I have already submitted a bug report for this but wanted to get some thoughts from other scripters, thank you!

  1. What do you want to achieve?

I have some NPCs that I only want to appear on the client, not on the server. I want these NPCs to hold tools such as swords.

  1. What is the issue?

NPCs spawned on the client appear to not be able to equip tools properly. When equipped a tool to an NPC spawned on the client, whether it is parented directly to the NPC or when using the Humanoid:EquipTool() function, the tool will appear correctly as a child of the NPC but the tool handle itself will not be attached and appears on the ground in front of the NPC. This issue does not occur with NPCs spawned on the server.

  1. What solutions have you tried so far?

The only solution I can find is that I have to weld the tools manually instead of relying on the Roblox’s tool system to equip them properly, but I am wondering if anyone else has had this issue and knows of a reason that NPCs spawned on the client would behave differently than those spawned on the server?

Here is a test file where you can see the issue very clearly:
NPCToolEquipTest.rbxl (85.8 KB)

  1. Using the attached project file, hit Play.
  2. You will see 4 NPCs spawn. The two NPCs on the left are being spawned on the client. The two on the right are being spawned on the server.
  3. Note that the two NPCs spawned on the client have tool children, but the tool handles appear on the ground in front of them. One tool is being parented directly to the NPC, the other is using Humanoid:EquipTool().
  4. Note that the two NPCs spawned on the server have their tools correctly equipped.
1 Like

This is probably a security thing that is supposed to work this way. This stops players from injecting things into the game from the client side. Not sure what the use case is for a client side only NPC but you could program the tool functionality without using the built in Tool objects. As you said you could weld them or build them directly into the NPC rig using Motor6D so they could be animated easily.

1 Like

That may be the case. Unless this is a bug, it seems like I’ll have to write my own Tool system for the client.

As for why I’d want NPCs on client side, I have enemies that I only want certain players to be able to fight. Since I have a lot of enemies in the world, for performance reasons I spawn them on the client, otherwise I’d have potentially 100s of enemies being replicated from server > client at all times. Spawning them on the client of course means only that player can fight them, but for my game that is fine. I have other boss enemies that are created on the server for everyone to fight cooperatively.