diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-10-24 12:10:40 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-10-24 12:10:40 -0400 |
| commit | 09de17b25912ca1ed79afcf9ecfc3291fe34a96d (patch) | |
| tree | 82e842a8cfe8247b44cf6a778eca54a4beb08995 /gamemode/shared/prayersystem/prayers/thickskin.lua | |
| parent | 3347d78a48e08084606e8902d6580a025ab2f793 (diff) | |
| download | artery-09de17b25912ca1ed79afcf9ecfc3291fe34a96d.tar.gz artery-09de17b25912ca1ed79afcf9ecfc3291fe34a96d.tar.bz2 artery-09de17b25912ca1ed79afcf9ecfc3291fe34a96d.zip | |
fixed prayers to work with the prayer system
Diffstat (limited to 'gamemode/shared/prayersystem/prayers/thickskin.lua')
| -rw-r--r-- | gamemode/shared/prayersystem/prayers/thickskin.lua | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/gamemode/shared/prayersystem/prayers/thickskin.lua b/gamemode/shared/prayersystem/prayers/thickskin.lua index 41d5fb5..739a8b9 100644 --- a/gamemode/shared/prayersystem/prayers/thickskin.lua +++ b/gamemode/shared/prayersystem/prayers/thickskin.lua @@ -1,22 +1,22 @@ --[[ - An example item + An example prayer ]] -local item = {} +local prayer = {} --Required, a name, all item names must be unique -item.Name = "Thick Skin" +prayer.Name = "Thick Skin" --Optional, a tooltip to display when hovered over -item.Tooltip = "A prayer to the warrior god to grant you 20% resistance to all dammage" +prayer.Tooltip = "A prayer to the warrior god to grant you 20% resistance to all dammage" --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) +prayer.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) +prayer.DeSerialize = function(self,string) print("Trying to deserialize!") return self end @@ -34,14 +34,14 @@ if SERVER then end end) end -if CLIENT then - local lastprayer = CurTime() - prayer.Pray = function(self) - if CurTime() > lastprayer + 0 then - net.Start("art_prayer_thickskin") - net.SendToServer() - lastprayer = CurTime() - end + +local lastprayer = CurTime() +prayer.Pray = function(self) + if SERVER then return end + if CurTime() > lastprayer + 0 then + net.Start("art_prayer_thickskin") + net.SendToServer() + lastprayer = CurTime() end end hook.Add( "EntityTakeDamage" , "artery_thickskin" , function(ent,info) @@ -51,9 +51,9 @@ hook.Add( "EntityTakeDamage" , "artery_thickskin" , function(ent,info) end) --Optional. Something run once when this item is drawn in a backpack -function item.DoOnPanel(dimagebutton) +function prayer.DoOnPanel(dimagebutton) dimagebutton:SetImage( "prayericons/thickskin.png") end -ART.RegisterPrayer(item) +ART.RegisterPrayer(prayer) |
