• Help with Healthkit and Armor for DarkRP
    2 replies, posted
Hey Guys! I am setting up a [B]DarkRP server[/B] right now and I can't seem to find any [B]Health or Armor[/B] addons. I tried to write one myself but the lua errors indicated that I am not able to do so :C I would like to use the code from the[B] original HL2 entities[/B] from Gmod but cant find the files anywhere. Help would be appreciated Thanks in advance
The original HL2 entities are coded in C++. Unless you're magical, you wont be able to port them in easy mode. What was your code and what were your lua errors?
[QUOTE=Sm63;43344115]The original HL2 entities are coded in C++. Unless you're magical, you wont be able to port them in easy mode. What was your code and what were your lua errors?[/QUOTE] I just downloaded an Addon and then used it as an entity for the medic. For the armor i just edited all the "Health" in the commands to "Armor" I could spawn it with no problems via the tab in the f4 menu. but pressing e didn't work. (my HP were low) [QUOTE]local ITEM = {} ITEM.ID = "healthkit" ITEM.Name = "A health kit" ITEM.Price = 150 ITEM.Info = "An effective healthkit." ITEM.Type = "health" ITEM.Remove = true ITEM.Energy = 0 ITEM.Model = "models/Items/HealthKit.mdl" ITEM.Permit = "medicine" function ITEM.Spawn( p ) GMRP.BaseItemSpawn( p, ITEM ) end function ITEM.Use( p, ent ) p:SetHealth(100) local HealthAmount = 100 if ( p:Health() + HealthAmount ) >= 100 then p:SetHealth( 100 ) p:GreenNotify( "You ate enough." ) else p:SetHealth( p:Health() + HealthAmount ) p:GreenNotify("+"..HealthAmount.." health") end end GMRP.AddItem(ITEM) [/QUOTE]
Sorry, you need to Log In to post a reply to this thread.