diff options
Diffstat (limited to 'gamemode/itemsystem')
| -rw-r--r-- | gamemode/itemsystem/exampleitem.lua | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gamemode/itemsystem/exampleitem.lua b/gamemode/itemsystem/exampleitem.lua index 066e107..ab7dc50 100644 --- a/gamemode/itemsystem/exampleitem.lua +++ b/gamemode/itemsystem/exampleitem.lua @@ -28,6 +28,17 @@ function item.GetOptions(self) options["toste"] = function() print("You pressed toste!") end return options end +if CLIENT then + local svg = nrequire("cl_svg.lua") + local thismat = svg.MaterialFromSVG("materials/svg/delapouite/originals/svg/000000/transparent/anubis.svg") + function item.OnEqpPaint(panel,w,h) + if thismat.material then + surface.SetDrawColor(255,255,255) + surface.SetMaterial(thismat.material) + surface.DrawTexturedRect( 0, 0, w, h ) + end + end +end --Optional. Something run once when this item is drawn in a backpack function item.DoOnPanel(dimagebutton) @@ -58,7 +69,7 @@ item.Shape = { } --Optional, If this item can be equiped in any player slots, put them here. -item.Equipable = "Right" +item.Equipable = "Right Hand" --Optional, what to do when the player clicks, and this item is in the slot in inventory. only works for items equipable in left and right item.onClick = function(self,owner) @@ -82,4 +93,5 @@ end print("Hello from exampleitem.lua") --Don't forget to register the item! -nrequire("item.lua").RegisterItem(item) +local itm = nrequire("item.lua") +itm.RegisterItem(item) |
