Jump to content

Recommended Posts

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 by AkaiNight
Link to comment
https://forums.kleientertainment.com/forums/topic/90968-cooldown-for-a-perk/
Share on other sites

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 :wilson_dorky:

Edited by SuperDavid
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 :wilson_dorky:

Thank you so much i don't have time right now but thanks.

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
×
  • Create New...