aboutsummaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/weapons/rustyaxe.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/itemsystem/weapons/rustyaxe.lua')
-rw-r--r--gamemode/itemsystem/weapons/rustyaxe.lua20
1 files changed, 14 insertions, 6 deletions
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)