• Duplicating An Entity
    4 replies, posted
I know this is a really dumb question and I hope its not a serious both to the forum. I am brand new to GMod, and even newer to Lua. I set up my server and installed a pile of pre-made Addons. Learning the config settings of each and have just recently started to dabble in some modifications in order to make my server more custom. I have purchased and installed an Add On called Armor Suit, which allows you to set a player model that gives the wearer a bonus to health,armor, etc. The system comes with 3 Crate entities and they all look the same besides the text added that floats above them. What I'm trying to do is create another 3 of these little crates so I can have 6 armors. How do I create these 3 new entities? I'm not asking for someone to create the code for me to clone these or to walk me through some complex steps. I've looked at how to create an entity and remain somewhat lost. ents.Create If you could just point me in the right direction I'm sure I can use that information to figure it out. I'm almost positive its a terminology thing - like I'm searching for how to create an entity, but I should be searched for how to create X. Thanks in advance, I sincerely appreciate any help.
before i go off explaining something i read wrong, i'll ask. what i'm getting is that you want three more entities to be able to spawn in the spawnmenu, correct? for example, instead of having, say, a 25, 50, and 100 armor entity, you want something like 10, 25, 30, 50, 75, 100 all to be able to spawn in the spawnmenu?
That's correct. The current armor add looks like this: Armor:Add({ Name = "Tier 2", Length = ( 600 * 1 ), Description = "+150 Armor, +150 Health", Model = "models/suits/robber_open.mdl", Entitie = "armor_tau", Price = 65000, OnGive = function( ply ) ply:SetArmor( 150 ) ply:SetHealth( 250 ) end, OnRemove = function( ply ) ply:SetArmor( 0 ) ply:SetHealth( 100 ) ply:SetJumpPower( 200 )  if ( ply._oldRunSpeed ) then ply:SetRunSpeed( ply._oldRunSpeed ) ply._oldRunSpeed = nil end end, }) and it seems "entitie" needs to be unique for each one.
yeah okay, so i think you're gonna have to create a new entity in [addon name]/lua/entities. judging by the looks of this addon, you should be able to just copy the folder or lua file and name it something unique, then rename Entitie and all that jazz
This is so embarrassing. You are correct. I had assumed I was supposed to find an entity in the Q menu and then plug in that name. But alas, its just creating them. WOW! I'm so sorry to waste your time. Greatly appreciated though!
Sorry, you need to Log In to post a reply to this thread.