--[[ An example item ]] local item = {} --Required, a name, all item names must be unique item.Name = "Nine Lives" --Optional, a tooltip to display when hovered over item.Tooltip = "A prayer to the rouge god to prevent fall dammage for the next 9 falls that you would have taken dammage, or for 5 minutes, whichever comes first." --Required Returns the data needed to rebuild this item, should only contain the minimum data nessessary since this gets sent over the network item.Serialize = function(self) print("Trying to serailize!") return "" end --Required, Rebuilds the item from data created in Serialize, if the item is different from the "main" copy of the item, it should retun a tabl.Copy(self), with the appropriate fields set. item.DeSerialize = function(self,string) print("Trying to deserialize!") return self end --Optional, when the player clicks this item, a menu will show up, if the menu item is clicked, the function is ran. This is all run client side, so if you want it to do something server side, you'll need to use the net library. Remember that items are in the shared domain, so you can define what it does in the same file! local prayedplayers = {} if SERVER then util.AddNetworkString("art_prayer_ninelives") net.Receive("art_prayer_ninelives",function(ln,ply) if ply:HasItem("Nine Lives") then prayedplayers[ply] = 9 timer.Simple(60 * 5,function() prayedplayers[ply] = nil end) end end) end function item.GetOptions(self) local options = {} options["Pray"] = function() net.Start("art_prayer_ninelives") net.SendToServer() end return options end hook.Add( "EntityTakeDamage" , "artery_ninelives" , function(ent,info) if info:GetDamageType() == DMG_FALL and prayedplayers[ent] ~= nil and prayedplayers[ent] > 0 then info:SetDamage(0) end end) --Optional. Something run once when this item is drawn in a backpack function item.DoOnPanel(dimagebutton) dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe.png") end --Optional. Something run once when this item is drawn in an equiped slot function item.DoOnEqupPanel(dimagebutton) print("called with panel:",panel) dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe_eq.png") end --Optional. Called continuously, use if you need the item to display different stuff at different tiems in the backpack. function item.Paint(self,width,height) draw.RoundedBox(4, 0,0,width,height,Color(0,100,0)) end --Optional. Called continuously, use if you need the item to display different stuff at different tiems when equiped. function item.PaintEquiped(self,width,height) draw.RoundedBox(4, 0,0,width,height,Color(0,100,0)) end --Required, the shape of this item in a backpack. item.Shape = { {true}, } ART.RegisterItem(item)