function Creature:onTargetCombat(target)
if not self then return true end
if self:isPlayer() and target:isPlayer() and self:getStorageValue(15001) == 1 and target:getStorageValue(Lib_Battle_Info.TeamOne.storage) == 1 then
self:sendCancelMessage("You may not attack your team mates.")
return false
end
return true
end
if something then
return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
end
You have to return RETURNVALUE_ values when using Creature.onTargetCombat.
e.g
Code:if something then return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER end