• Equipment Item
    7 replies, posted
So, I want to make an Equipment Item, but can't find out how to make it in the Traitor Menu. I don't want to edit game files because I want to publish it on Workshop later. I have found this page: [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/terrortown/gamemode/equip_items_shd.lua[/url] It says something that I can add equipment with some kind of tables but I don't know how and where to put the files. Could someone help me with it?
In a shared autorun file add [lua] table.insert(EquipmentItems[ROLE_TRAITOR], { id = EQUIP_*, loadout = false, -- default equipment for detectives type = "item_passive", material = mat_dir .. "icon_armor", //change name = "item_armor", //change desc = "item_armor_desc" //change }) [/lua] And just change the name to the entity/item name, and desc whatever the description is. Look at the other items to see how it's done.
[QUOTE=crazyscouter;48196940]In a shared autorun file add [lua] table.insert(EquipmentItems[ROLE_TRAITOR], { id = EQUIP_*, loadout = false, -- default equipment for detectives type = "item_passive", material = mat_dir .. "icon_armor", //change name = "item_armor", //change desc = "item_armor_desc" //change }) [/lua] And just change the name to the entity/item name, and desc whatever the description is. Look at the other items to see how it's done.[/QUOTE] I want it to be a separate file that I can add in an folder so I can upload it to workshop. Theres still one thing I don't understand. Where should I put the icon?
Change the material = to "path/to/you/material.png"
[QUOTE=crazyscouter;48197066]Change the material = to "path/to/you/material.png"[/QUOTE] Where is the path starting? I always have problem with that in gmod And what do you mean with shared file? (I am new to gmod lua coding)
The path is relative to your material/ folder. Shared means it gets ran on both the client and server. Typically in lua/autorun/myfile.lua
*REMOVED*
bump
Sorry, you need to Log In to post a reply to this thread.