Jump to content

Weapon attack cooldown


Recommended Posts

@skapmet:

-- For one weapon only-- in yourweapon.lualocal function onequip(inst, owner)	-- other code goes here	local cooldown = owner.components.combat.min_attack_period + 2    owner.components.combat:SetAttackPeriod(cooldown)endlocal function onunequip(inst, owner)	-- other code goes here	local cooldown = owner.components.combat.min_attack_period - 2    owner.components.combat:SetAttackPeriod(cooldown)end-- inst:AddComponent("equippable")-- inst.components.equippable:SetOnEquip(onequip)-- inst.components.equippable:SetOnUnequip(onunequip)-- For all weapons for your character-- in character.lua-- in master_postinitinst.components.combat:SetAttackPeriod(2)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...