oen432
Legendary OT User
Because you had disabled onTargetCombat event and had bad code inside that event.sorry if i'm in the way, but the problem started after supporting the events upgrade on the creature =/
Here is fixed code.
Lua:
function Creature:onTargetCombat(target)
target:registerEvent("ItemSetsHealth")
target:registerEvent("UpgradeSystemHealth")
target:registerEvent("UpgradeSystemDeath")
if self:getStorageValue(STORAGEVALUE_WAR_GREENPLAYER_BOOL) == 1 then
if target:getStorageValue(STORAGEVALUE_WAR_REDPLAYER_BOOL) == 1 then
return RETURNVALUE_NOERROR
elseif target:getStorageValue(STORAGEVALUE_WAR_REDPLAYER_BOOL) == 0 then
self:sendCancelMessage("You cannot attack someone that is on your team.")
return false
end
elseif self:getStorageValue(STORAGEVALUE_WAR_REDPLAYER_BOOL) == 1 then
if target:getStorageValue(STORAGEVALUE_WAR_GREENPLAYER_BOOL) == 1 then
return RETURNVALUE_NOERROR
elseif target:getStorageValue(STORAGEVALUE_WAR_GREENPLAYER_BOOL) == 0 then
self:sendCancelMessage("You cannot attack someone that is on your team.")
return false
end
end
end