aboutsummaryrefslogtreecommitdiff
path: root/gamemode/shared/itemsystem/foodstuffs/ratmeat.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-10-24 21:52:20 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-10-24 21:52:20 -0400
commit78e40d9fd55b6ba23db4f459e2c7e9ae2109cf5a (patch)
tree3c87a74fb2c6a792a93c7f242d9e92e478f4f77a /gamemode/shared/itemsystem/foodstuffs/ratmeat.lua
parent9ae67530dc4be9eaab7b1243330e810d1d5a6fee (diff)
downloadartery-78e40d9fd55b6ba23db4f459e2c7e9ae2109cf5a.tar.gz
artery-78e40d9fd55b6ba23db4f459e2c7e9ae2109cf5a.tar.bz2
artery-78e40d9fd55b6ba23db4f459e2c7e9ae2109cf5a.zip
Allowed items to be dropped
Diffstat (limited to 'gamemode/shared/itemsystem/foodstuffs/ratmeat.lua')
-rw-r--r--gamemode/shared/itemsystem/foodstuffs/ratmeat.lua44
1 files changed, 44 insertions, 0 deletions
diff --git a/gamemode/shared/itemsystem/foodstuffs/ratmeat.lua b/gamemode/shared/itemsystem/foodstuffs/ratmeat.lua
new file mode 100644
index 0000000..8990a49
--- /dev/null
+++ b/gamemode/shared/itemsystem/foodstuffs/ratmeat.lua
@@ -0,0 +1,44 @@
+--[[
+ An example item
+]]
+local item = {}
+
+--Required, a name, all item names must be unique
+item.Name = "Rat Meat"
+
+--Optional, a tooltip to display when hovered over
+item.Tooltip = "Disgusting, disease-ridden meat."
+
+--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!
+function item.GetOptions(self)
+ local options = {}
+ options["test"] = function() print("You pressed test!") end
+ options["toste"] = function() print("You pressed toste!") end
+ return options
+end
+
+--Optional. Something run once when this item is drawn in a backpack
+function item.DoOnPanel(dimagebutton)
+ --dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe.png")
+end
+
+--Required, the shape of this item in a backpack.
+item.Shape = {
+ {true}
+}
+
+
+--Don't forget to register the item!
+ART.RegisterItem(item)