Garry's Mod

Garry's Mod

Not enough ratings
Creating addon for Equipment Launcher
By Живчик
Here is guide how to add custom bombs in Equipment Launcher
   
Award
Favorite
Favorited
Unfavorite
Requirements
  • YOU NEED A NOTEPAD OR OTHER TEXT EDITOR.
  • You need ready-made entity (bomb from gbombs etc).
Adding bomb to EqLaun
First step.
Create folder in your addons folder, it will be your addon
In new folder create "lua" folder, in lua create "autorun" folder.
Here you need create *youraddonname*.lua, it will contain code of addon

Second step.
In *youraddonname*.lua add these strings
hook.Add("Initialize", "add CB", function() local bomb = { name = "bomb name", -- Your bomb name bombclass = "entity class", -- Bomb class (In spawnmenu RMB on entity you want -> "Copy to clipboard") bind = "cb_yourbomb", -- Bind to launch bomb cooldown = 30, -- Cooldown, shoulde be integer value between 0 and 127 hudcolor = Color(50, 50, 50, 200), -- Color in HUD hudicon = "", -- Icon in HUD, set to "" if it doesn`t have icon, icon should located in "garrysmod/materials/icon.png" in this case you need write "icon.png" useonspawn = false -- Set true if bomb need to be used } EqLaun:CreateNewBomb( bomb ) end)

After that, restart map and bomb should be exist.
You should get message like that "EqLaun: Your Bomb Name Bomb Added"

How to change default bombs
Your bomb name should be "Standart Grenade" or "Freeze bomb"