Jump to content
Sign in to follow this  
Dan

LF> Gyoza Cooldown Timer

Recommended Posts

Looking for a cooldown timer for Gyoza

Example: When a player uses Gyoza pot, they must wait 30 seconds before using another gyoza.


Nissan-GT-R.gif

Share this post


Link to post
Share on other sites
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

 

  • Like 3

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...