• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Count Stats every X seconds

Status
Not open for further replies.
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

I got 10 Players. Every Player can choose one hero.

Now I want count every second the Str, Agi and Int of the (max) 10 Heroes.
I want try it with 1 variable. But how?

====
Why I want use this?: I got some other Heros on the map. And I want set the stats of this heros to the counted Stat of the (max) 10 Heroes.

Maybe someone got an idea for this .. and if I count it every seconds will the game lag?
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
You don't have to count this every second as there is a function that does it.

JASS:
GetHeroAgi(whichHero, includeBonuses)
GetHeroInt(whichHero, includeBonuses)
GetHeroStr(whichHero, includeBonuses)
// There are functions which return hero stats
// Make second argument (includeBonuses) true or false
// You can call it from GUI simply making a integer variable eg. TempInt to handle the transfer

// Here is an example of custom script
CustomScript: set udg_TempInt = GetHeroAgi(GetTriggerUnit(), true)
 
Status
Not open for further replies.
Top