• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Spell Cooldown problem

Status
Not open for further replies.
Level 12
Joined
Jul 28, 2007
Messages
920
Does anyone know how can i set some variable to 1, when unit is casting ability, and then after few seconds set it again to 0,
or is there any way to detect when cooldown of some spell is done ?

This doesnt works.

When unit casts ability
set (variable),player number of casting unit, to 1
wait 10 sec (time until specific spell gets cooldowned)
set (variable),player number of casting unit, to 0
 
U need local variables for that, because Casting Unit is an Event-reaction wich probally doesnt match after 10 seconds.

Try this, im using a bolean_variable_array, but u can use your integer_array exactly in the same way ;)
  • Spell
    • Events
      • Unit - A unit Beginns casting an ability
    • Conditions
    • Actions
      • Custom script: local unit u=GetSpellAbilityUnit()
      • Custom script: set udg_Bolean[GetPlayerId(GetOwningPlayer(u))+1]=true
      • Wait 10.00 seconds
      • Custom script: set udg_Bolean[GetPlayerId(GetOwningPlayer(u))+1]=false
Many Custom Scripts ;), but like this it will work. I thought u might want boleans as your using 0 and 1 like true and false ;)

Greets Emm-A-
 
Status
Not open for further replies.
Back
Top