View Single Post
Senior Member
Join Date: Jul 2010
Posts: 2,994

Old May 3rd, 2019, 03:22 AM
Originally Posted by Nokowi View Post
foreach pick in hero where "wCategory.Melee?"
hero.findchild[BaseWep,"wCategory.Melee"].field[livename].text = " "

Here is what I have so far, but it keeps returning to the first instance where it finds a melee weapon.

Very new to programming. Is there a way to cycle to the next instance this is true?
When using the foreach loop, you are asking HL to look for all instances on the hero that have the tag placed within the quotes. In this case "wCategory.Melee?". To affect all of those cases you need to use 'each' within the loop like this:

foreach pick in hero where "wCategory.Melee?"
  each.field[livename].text = "test"
This line of code would change all things on your character with that tag to have the livename test.
Sendric is offline   #4 Reply With Quote