so I have been trying to make an armour entity that gives 100% armour on use.
First problem I have encountered is that when I use the entity it doesn’t give armour and it “disappears” or better explained it just becomes invisible except for its shadow.
The prop is still touchable via gravitygun and physgun so it doesn’t get removed properly.
Here are the 3 files:
AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua") function ENT:Initialize() self:SetModel("models/Items/battery.mdl") end function ENT:Use( activator, caller, useType, value ) activator:SetArmor( 100 ) self.Entity:Remove() end
include("shared.lua") function ENT:Draw() end function ENT:Initialize() self:DrawShadow(false) end
ENT.Type = "anim" ENT.Base = "base_gmodentity" ENT.PrintName = "Kevlar" ENT.Author = "『 』" ENT.Spawnable = false ENT.AdminSpawnable = true