aboutsummaryrefslogtreecommitdiff
path: root/gamemode/itemsystem
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/itemsystem')
-rw-r--r--gamemode/itemsystem/armor/balaclava.lua2
-rw-r--r--gamemode/itemsystem/exampleitem.lua2
-rw-r--r--gamemode/itemsystem/weapons/rustyaxe.lua20
3 files changed, 16 insertions, 8 deletions
diff --git a/gamemode/itemsystem/armor/balaclava.lua b/gamemode/itemsystem/armor/balaclava.lua
index dd0ec83..1ea094b 100644
--- a/gamemode/itemsystem/armor/balaclava.lua
+++ b/gamemode/itemsystem/armor/balaclava.lua
@@ -11,7 +11,7 @@ item.Tooltip = "Something to cover your face"
--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!")
+ print("Trying to Serialize!")
return ""
end
diff --git a/gamemode/itemsystem/exampleitem.lua b/gamemode/itemsystem/exampleitem.lua
index ab7dc50..a56151f 100644
--- a/gamemode/itemsystem/exampleitem.lua
+++ b/gamemode/itemsystem/exampleitem.lua
@@ -86,7 +86,7 @@ item.onUnEquip = function(self,who)
print("Aw, I'm being stored :(")
end
---Technically optional, but item will display as a rock if you don't have it. If you want to do something other than drop on dropped, remove ent.
+--Technically optional, but item will display as a rock if you don't apply a pac to it. If you want to do something other than drop on dropped, remove ent.
item.onDropped = function(self,ent)
print("I've been dropped!(BUVVV WUB WUB WUB WUB WUB)")
end
diff --git a/gamemode/itemsystem/weapons/rustyaxe.lua b/gamemode/itemsystem/weapons/rustyaxe.lua
index 04e54de..c19a24a 100644
--- a/gamemode/itemsystem/weapons/rustyaxe.lua
+++ b/gamemode/itemsystem/weapons/rustyaxe.lua
@@ -1,6 +1,12 @@
--[[
An example item
]]
+local pac
+if SERVER then
+ pac = nrequire("core/pac/sv_pac.lua")
+ print("in rustyaxe.lua, pac is", pac)
+end
+local reg = nrequire("item.lua")
local item = {}
--Required, a name, all item names must be unique
@@ -47,7 +53,7 @@ item.Shape = {
}
--Optional, If this item can be equiped in any player slots, put them here.
-item.Equipable = "Right"
+item.Equipable = "Right Hand"
local swingdata = {
["fwd"] = {
@@ -205,9 +211,10 @@ item.onEquip = function(self,who)
print("onEquip",who)
if CLIENT then print("onEquip client!") end
if SERVER then
+ print("pac is", pac)
PrintTable(pac)
who:GetActiveWeapon():SetHoldType("melee")
- ART.ApplyPAC(who,"rustyaxe")
+ pac.ApplyPac(who,"rustyaxe")
--local outfit = pac.luadata.ReadFile("pac3/mech.txt")
--who:AttachPACPart(outfit)
--print("onEquip server!")
@@ -216,14 +223,15 @@ end
--Optional, if we should do something speical on unequip(like setting animations back to normal)
item.onUnEquip = function(self,who)
+ print("Unequiping axe")
who:GetActiveWeapon():SetHoldType("normal")
- ART.RemovePAC(who,"rustyaxe")
+ if SERVER then pac.RemovePac(who,"rustyaxe") end
end
item.onDropped = function(self, ent)
- ART.ApplyPAC(ent,"rustyaxe")
+ if SERVER then pac.ApplyPac(ent,"rustyaxe") end
end
-print("Hello from scrapgun.lua")
+print("Hello from rustyaxe.lua")
--Don't forget to register the item!
-nrequire("item.lua").RegisterItem(item)
+reg.RegisterItem(item)