- Joined
- Jun 16, 2008
- Messages
- 333
I am trying to change the owner of a circle of power and have the color change.
Lua:
function HeroTele()
local coP = GetUnitsOfPlayerAndTypeId(Player(PLAYER_NEUTRAL_PASSIVE), FourCC("bcop"))
ForGroup(coP, CircleofPower)
DestroyGroup(coP)
end
function CircleofPower()
local EnumcoP = GetEnumUnit()
local coPCollision = CreateTrigger()
TriggerRegisterUnitInRangeSimple(coPCollision, 56, EnumcoP)
TriggerAddAction(coPCollision, function() coPTele(EnumcoP) end)
print(GetPlayerController(GetOwningPlayer(EnumcoP)))
end
function coPTele(a)
print(a)
if GetPlayerController(GetOwningPlayer(GetTriggerUnit())) ~= Player(15) then
print("in trigger")
SetUnitOwner(a, GetPlayerController(GetOwningPlayer(GetTriggerUnit())), TRUE)
print(GetOwningPlayer(a))
end
end