diff options
Diffstat (limited to 'gamemode/shared/prayersystem/prayers/ninelives.lua')
| -rw-r--r-- | gamemode/shared/prayersystem/prayers/ninelives.lua | 28 |
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) |
