AkaiNight Posted May 19, 2018 Share Posted May 19, 2018 (edited) Hello, i'm trying to add my character a skill (freeze everything if take enough damage and i want to add some cooldown for this ability. so i don't have any idea about how to make. I hope you guys can help me. So thanks for help. Edit: The cooldown must be 1 day at autm and spring and 2 days for summer and 1/2 day for winter. Edited May 19, 2018 by AkaiNight Link to comment https://forums.kleientertainment.com/forums/topic/90968-cooldown-for-a-perk/ Share on other sites More sharing options...
. . . Posted May 19, 2018 Share Posted May 19, 2018 (edited) this should work i think Spoiler if inst.iceblast_cd == nil then inst.iceblast_cd = true --do your stuff like applying coldness to your attackers and stuff if TheWorld.state.isspring or TheWorld.state.isautumn then --if "TheWorld.state.isautumn" won't work replace with "TheWorld.state.isfall" i dont remember exact code names for this stuff inst:DoTaskInTime(480, function() inst.iceblast_cd = nil end) --480 is 1 dst day about 8 minutes in real life elseif TheWorld.state.issummer then inst:DoTaskInTime(960, function() inst.iceblast_cd = nil end) elseif TheWorld.state.iswinter then inst:DoTaskInTime(240, function() inst.iceblast_cd = nil end) end end you add it to your function/event for doing the ice blast or whatever, hope it works for you Edited May 19, 2018 by SuperDavid Link to comment https://forums.kleientertainment.com/forums/topic/90968-cooldown-for-a-perk/#findComment-1036577 Share on other sites More sharing options...
AkaiNight Posted May 22, 2018 Author Share Posted May 22, 2018 On 20.05.2018 at 2:47 AM, SuperDavid said: this should work i think Hide contents if inst.iceblast_cd == nil then inst.iceblast_cd = true --do your stuff like applying coldness to your attackers and stuff if TheWorld.state.isspring or TheWorld.state.isautumn then --if "TheWorld.state.isautumn" won't work replace with "TheWorld.state.isfall" i dont remember exact code names for this stuff inst:DoTaskInTime(480, function() inst.iceblast_cd = nil end) --480 is 1 dst day about 8 minutes in real life elseif TheWorld.state.issummer then inst:DoTaskInTime(960, function() inst.iceblast_cd = nil end) elseif TheWorld.state.iswinter then inst:DoTaskInTime(240, function() inst.iceblast_cd = nil end) end end you add it to your function/event for doing the ice blast or whatever, hope it works for you Thank you so much i don't have time right now but thanks. Link to comment https://forums.kleientertainment.com/forums/topic/90968-cooldown-for-a-perk/#findComment-1037118 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