From 09de17b25912ca1ed79afcf9ecfc3291fe34a96d Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 24 Oct 2016 12:10:40 -0400 Subject: fixed prayers to work with the prayer system --- .../prayersystem/prayers/preditorinstinct.lua | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'gamemode/shared/prayersystem/prayers/preditorinstinct.lua') diff --git a/gamemode/shared/prayersystem/prayers/preditorinstinct.lua b/gamemode/shared/prayersystem/prayers/preditorinstinct.lua index 8ba7b87..988904c 100644 --- a/gamemode/shared/prayersystem/prayers/preditorinstinct.lua +++ b/gamemode/shared/prayersystem/prayers/preditorinstinct.lua @@ -1,13 +1,13 @@ --[[ An example item ]] -local item = {} +local prayer = {} --Required, a name, all item names must be unique -item.Name = "Preditor Instinct" +prayer.Name = "Preditor Instinct" --Optional, a tooltip to display when hovered over -item.Tooltip = "A prayer to the rouge god to grant you 30% movement when chaseing a wounded target" +prayer.Tooltip = "A prayer to the rouge god to grant you 30% movement when chaseing a wounded target" --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 = {} @@ -22,14 +22,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_preditorinstinct") - 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_preditorinstinct") + net.SendToServer() + lastprayer = CurTime() end end --called continuously to buff players @@ -60,8 +60,8 @@ end buffplayers() --Optional. Something run once when this item is drawn in a backpack -function item.DoOnPanel(dimagebutton) +function prayer.DoOnPanel(dimagebutton) dimagebutton:SetImage( "prayericons/preditorinstinct.png") end -ART.RegisterPrayer(item) +ART.RegisterPrayer(prayer) -- cgit v1.2.3-70-g09d2