Trigger
Event
Every 10 seconds
Condition
Action
Unit group - Pick every unit in playable map area and do actions
Loop - actions
If (all conditions are true) then do (then actions) else do (else actions)
If - conditions
Unit type of picked unit is market equals to true
Then - actions
Set tempPoint = position of market
Player - set lumber of owner of picked unit = lumber of owner of picked unit + 10
Floating text - Create a floating text at tempPoint saying +10 with colour 00 00 100
Set tempText = last created floating text
Floating text - Change velocity of tempText to 64 to 90 degrees
Floating text - Change fading age of tempText to 2 seconds
Custom Script: call RemoveLocation(udg_tempPoint)
Set tempPoint = no floating text
Else - actions
It destroys a Unit Group action right after its usage
Usually, this custom script is used IF your Unit Group is NOT a variable
If it's a variable, you must follow wolfman's suggestion
Put that custom script right above the Unit Group action
Farm
Building
Events
Time - Every 5.00 seconds of game time
Conditions
Actions
Custom script: set bj_wantDestroyGroup=true
Unit Group - Pick every unit in (Units of type Farm) and do (Actions)
Loop - Actions
Custom script: local unit building = GetEnumUnit()
Custom script: local location b = GetUnitLoc(building)
Custom script: call CreateTextTagLocBJ( "+10", b, 0, 10, 100, 100, 100, 0 )
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
Floating Text - Change the age of (Last created floating text) to 3.00 seconds
Custom script: set building = null
Custom script: set b = null
And who said I was saying that it works ONLY for... Local ???It would work for a global variable too.
If it's a variable, you must follow wolfman's suggestion
Leaks location b. Add RemoveLocation(b) before setting the var to null. Also,if you're going to use JASS,don't use locations at all. (use coordinates)