aboutsummaryrefslogtreecommitdiff
path: root/gamemode/shared/prayersystem/prayers/ninelives.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-10-24 12:10:40 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-10-24 12:10:40 -0400
commit09de17b25912ca1ed79afcf9ecfc3291fe34a96d (patch)
tree82e842a8cfe8247b44cf6a778eca54a4beb08995 /gamemode/shared/prayersystem/prayers/ninelives.lua
parent3347d78a48e08084606e8902d6580a025ab2f793 (diff)
downloadartery-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/ninelives.lua')
-rw-r--r--gamemode/shared/prayersystem/prayers/ninelives.lua28
1 files changed, 13 insertions, 15 deletions
diff --git a/gamemode/shared/prayersystem/prayers/ninelives.lua b/gamemode/shared/prayersystem/prayers/ninelives.lua
index 4c7a13a..1f5a4e6 100644
--- a/gamemode/shared/prayersystem/prayers/ninelives.lua
+++ b/gamemode/shared/prayersystem/prayers/ninelives.lua
@@ -1,13 +1,13 @@
--[[
- An example item
+ An example prayer
]]
-local item = {}
+local prayer = {}
--Required, a name, all item names must be unique
-item.Name = "Nine Lives"
+prayer.Name = "Nine Lives"
--Optional, a tooltip to display when hovered over
-item.Tooltip = "A prayer to the rouge god to prevent fall dammage for the next 9 falls that you would have taken dammage, or for 5 minutes, whichever comes first."
+prayer.Tooltip = "A prayer to the rouge god to prevent fall dammage for the next 9 falls that you would have taken dammage, or for 5 minutes, whichever comes first."
--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!
local prayedplayers = {}
@@ -23,17 +23,15 @@ if SERVER then
end)
end
-if CLIENT then
- local lastprayer = CurTime()
- prayer.Pray = function(self)
- if CurTime() > lastprayer + 0 then
- net.Start("art_prayer_ninelives")
- net.SendToServer()
- lastprayer = CurTime()
- end
- end
- hook.Add("")
+local lastprayer = CurTime()
+prayer.Pray = function(self)
+ if SERVER then return end
+ if CurTime() > lastprayer + 0 then
+ net.Start("art_prayer_ninelives")
+ net.SendToServer()
+ lastprayer = CurTime()
+ end
end
hook.Add( "EntityTakeDamage" , "artery_ninelives" , function(ent,info)
@@ -48,4 +46,4 @@ function prayer.DoOnPanel(dimagebutton)
end
-ART.RegisterPrayer(item)
+ART.RegisterPrayer(prayer)