jcosmick Posted May 5, 2023 Share Posted May 5, 2023 Im trying to make an item (on body slot) that give the player the ability to freeze the target while attacking (with every weapon) but the freezing status apply before the damage so the enemy instantly unfreeze how can i apply it after the damage? i was listening on the "onattackother" event Link to comment https://forums.kleientertainment.com/forums/topic/147638-freezing-enemy-and-dealing-damage-with-body-slot-item/ Share on other sites More sharing options...
jcosmick Posted May 6, 2023 Author Share Posted May 6, 2023 ok this should work inst.combatfreezing = function(attacker, data) if data.target and data.target.components.freezable then data.target.components.freezable:AddColdness(0.67) inst.components.fueled:DoDelta(-0.02 * inst.components.fueled.maxfuel) data.target.components.freezable:SpawnShatterFX() end end inst:ListenForEvent("onhitother", inst.combatfreezing, owner) 1 Link to comment https://forums.kleientertainment.com/forums/topic/147638-freezing-enemy-and-dealing-damage-with-body-slot-item/#findComment-1633842 Share on other sites More sharing options...
Glommer2 Posted June 27, 2023 Share Posted June 27, 2023 what about adding a delay time like inst:ListenForEvent("onhitother", function() inst:DoTaskInTime(0.1,inst.combatfreezing) end , owner) Link to comment https://forums.kleientertainment.com/forums/topic/147638-freezing-enemy-and-dealing-damage-with-body-slot-item/#findComment-1643916 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now