Shadow
TH.net Regular
- Reaction score
- 23
Hey was learning the basics of vJass but its been 6 months since I last learned it
Need some help removing a unit.
Need to remove the unit created in this line
After its happened (units entered range) so I assume i'd put it in here
I think i'd have to somehow set the unit to a variable then use the
RemoveUnit function. But how do I set I know its like "set unit t ="
Need some help removing a unit.
Code:
scope SunQuan initializer onInit
public function ChangeOwner takes nothing returns nothing
call KillUnit(GetTriggerUnit())
call SetUnitOwner(GetEnumUnit(), GetOwningPlayer(GetTriggerUnit()), true)
call SetUnitOwner(GateSpawns_GateCaptain[1], GetOwningPlayer(GetTriggerUnit()), false)
endfunction
private function Conditions takes nothing returns boolean
call ForGroup(armies_Army[1], function ChangeOwner)
call ForGroup(armies_Army[2], function ChangeOwner)
return false
endfunction
private function onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call CreateUnit(Player(13), 'H006', -5950, 4400, 270)
call TriggerRegisterUnitInRange(t, CreateUnit(Player(13),'ncop',-6000,4270,90),100,null)
call TriggerAddCondition(t,Condition(function Conditions))
endfunction
endscope
Need to remove the unit created in this line
Code:
call TriggerRegisterUnitInRange(t, CreateUnit(Player(13),'ncop',-6000,4270,90),100,null)
After its happened (units entered range) so I assume i'd put it in here
Code:
public function ChangeOwner takes nothing returns nothing
call KillUnit(GetTriggerUnit())
call SetUnitOwner(GetEnumUnit(), GetOwningPlayer(GetTriggerUnit()), true)
call SetUnitOwner(GateSpawns_GateCaptain[1], GetOwningPlayer(GetTriggerUnit()), false)
endfunction
I think i'd have to somehow set the unit to a variable then use the
RemoveUnit function. But how do I set I know its like "set unit t ="