- Create a folder, name it something alike: gm_entity_name (without spaces, replace GM with short of your gamemode)
- Create 3 files inside: shared, cl_init, init.
- Put info inside shared:
And now, basically, all you have to do is the hooks to define entities functionality: http://wiki.garrysmod.com/page/Category:ENTITY_Hooks
Ofcourse, you have to remember to put shared hooks into shared.lua, serverside into init.lua etc.
Your functions also have (actually don’t have to, because you can use hook.Add, but it’s better to do it this way)
[lua]function ENT:HookName( arg, arg2 )
Cool thing is that you can call the entity using “self”, like: self:SetHealth( 500 )