December 2020
Posted 4 years ago
attribute 'contenteditable' not allowedattribute 'blocktype' not allowed

In GMod the weapon system was based on CBaseEntity in the engine. In s&box we don't even use the native classes. In s&box a weapon is just an entity with a bunch of interfaces implemented.

The weapon system is actually stupidly simple. It's based on the ActiveEntity system.

attribute 'contenteditable' not allowedattribute 'blocktype' not allowed
This function is called during the player's tick. If you have an ActiveChild and it's an IPlayerControllable, it'll also tick.

So on your gun entity you can do stuff like this.
attribute 'contenteditable' not allowedattribute 'blocktype' not allowed
And just for fun, here's the box shooter code

attribute 'contenteditable' not allowedattribute 'blocktype' not allowedattribute 'data-image-style' not allowed