#help with making a weapon system

1 messages · Page 1 of 1 (latest)

oak pagoda
#

Quick question about weapon system design

Right now:

  • Weapons are Tools in the Backpack
  • When clicked, I send the tool to the server
  • Server removes it from the Backpack when equipped

Goal:

  • Equipped weapons should NOT be in the Backpack
  • I want them drawn/used via a keybind (not tool selection)
  • Tools should only act as inventory items
  • System should be fully server-authoritative

Concern:

  • I’m currently passing the Tool instance from client → server, which feels unsafe and/or exploitable

Questions:

  • Should I keep passing the Tool instance and just validate it on the server?
  • Or switch to something like server-tracked ownership (IDs, etc.)?
  • How do you usually handle equip state when tools are removed from the Backpack?
midnight tapir
#

There is most likely a few options but two of them are either:

  • Keep that system but validate tool on server and try sending low in bytes, not an instance (Not Recommended)

  • Scrap your entire system and rebuild it using Services and Handlers, but not tools in instances, you can then hook up input connections (Reccomended to use an InputManager) to a bind that then has a callback function that handles the tool and etc

#

Remember to not handle other responsibilities in non-respective modules, keep everything in it’s word, meaning backpack related stuff in BackpackHandler /InventoryHandler and helper modules as childs and etc

#

Hope you get the jist of it

hearty root
#

If scripts are connected from client to server. Could exploiters get to the server??

midnight tapir
#

With that, they'll have no advantage