Hello someone can help me? Im getting this error:
Code:
Code:
LUA:
function Creature:onTargetCombat(target)
return stat_onTargetCombat(self, target)
end
if not __picif[target.uid] then
if target:isMonster() then
target:registerEvent("RewardSystemSlogan")
__picif[target.uid] = {}
end
end
if target:isPlayer() then
if self:isMonster() then
local protectionStorage = target:getStorageValue(Storage.combatProtectionStorage)
if target:getIp() == 0 then -- If player is disconnected, monster shall ignore to attack the player
if protectionStorage <= 0 then
addEvent(removeCombatProtection, 30 * 1000, target.uid)
target:setStorageValue(Storage.combatProtectionStorage, 1)
elseif protectionStorage == 1 then
self:searchTarget()
return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
end
return true
end
if protectionStorage >= os.time() then
return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
end
end
end
if ((target:isMonster() and self:isPlayer() and target:getType():isPet() and target:getMaster() == self) or (self:isMonster() and target:isPlayer() and self:getType():isPet() and self:getMaster() == target)) then
return RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE
end
if PARTY_PROTECTION ~= 0 then
if self:isPlayer() and target:isPlayer() then
local party = self:getParty()
if party then
local targetParty = target:getParty()
if targetParty and targetParty == party then
return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
end
end
end
end
if ADVANCED_SECURE_MODE ~= 0 then
if self:isPlayer() and target:isPlayer() then
if self:hasSecureMode() then
return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
end
end
end
if self:isPlayer() then
if target and target:getName() == staminaBonus.target then
local name = self:getName()
if not staminaBonus.events[name] then
staminaBonus.events[name] = addEvent(addStamina, staminaBonus.period, name)
end
end
end
return true
end