Dan 184 Report post Posted October 29, 2017 Looking for a cooldown timer for Gyoza Example: When a player uses Gyoza pot, they must wait 30 seconds before using another gyoza. Quote Share this post Link to post Share on other sites
Yomazu 20 Report post Posted October 29, 2017 Gyoza = {} function ItemUse_SSSJ ( role , Item ) local CharacterName = GetChaDefaultName(role) if Gyoza[CharacterName] == nil then Gyoza[CharacterName] = { UsedTime = os.time() } end local cooldown = Gyoza[CharacterName].UsedTime - os.time() if cooldown > 0 then BickerNotice(role,"Gyoza cooldown on effect wait "..cooldown.." second(s) to use again!") UseItemFailed(role) return end local hp = GetChaAttr(role, ATTR_HP) local mxhp = GetChaAttr(role,ATTR_MXHP) hp_resume = mxhp * 0.3 hp = hp + hp_resume if hp > mxhp then hp = mxhp end Gyoza[CharacterName] = { UsedTime = (os.time()+30) } SetCharaAttr(hp, role, ATTR_HP) end 3 Quote Share this post Link to post Share on other sites
Dan 184 Report post Posted October 30, 2017 Thanks. Quote Share this post Link to post Share on other sites