diff options
| author | Scott <scotth0828@gmail.com> | 2016-04-30 20:34:42 -0400 |
|---|---|---|
| committer | Scott <scotth0828@gmail.com> | 2016-04-30 20:34:42 -0400 |
| commit | bdf6cacc1fe7af364b93604253f3229d842d6170 (patch) | |
| tree | 21015081b4d66d45390ba625c09fb84d143f63db /gamemode/itemsystem/items/anexample.lua | |
| parent | e8fc8b5bf824ed3283dede946e66f5fd843d54ff (diff) | |
| parent | c6b56a911622f9a52fd92293074192d1f13d3e96 (diff) | |
| download | gmstranded-bdf6cacc1fe7af364b93604253f3229d842d6170.tar.gz gmstranded-bdf6cacc1fe7af364b93604253f3229d842d6170.tar.bz2 gmstranded-bdf6cacc1fe7af364b93604253f3229d842d6170.zip | |
Merge branch 'master' of ssh://cogarr.net:43/home/git/gmsurvival
Diffstat (limited to 'gamemode/itemsystem/items/anexample.lua')
| -rw-r--r-- | gamemode/itemsystem/items/anexample.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gamemode/itemsystem/items/anexample.lua b/gamemode/itemsystem/items/anexample.lua index 19cdbd7..100096f 100644 --- a/gamemode/itemsystem/items/anexample.lua +++ b/gamemode/itemsystem/items/anexample.lua @@ -14,5 +14,23 @@ ITEM.Icon = "test.png" --If this item has "unique data", for example batteries that run out of charge ITEM.UniqueData = false +--A table of strings to functions that show up when the player clicks the item in their inventory. +--The you may also use strings to tables of strings to functions (and so on) to make drop-down menus. +--Example: +--[[ +ITEM.Actions = { + "Click me!" = functions(player) print("I was clicked!") end + "Or me!" = functions(player) print("I was clicked by " .. player:Name()) end + "Drop down" = { + "This is an item in a drop down" = function(player) print("Drop1") end + "Drop downs can have more drop downs!" = { + "Drop2" = function(player) print("Drop2") end + "Drop3" = function(player) print("Drop3") end + } + } +} +--]] +ITEM.Actions = {} + --Be sure to register when everything is said and done! GMS.RegisterResource(ITEM) |
