The character must remain online if pk / pz locked.
The character will logout in few seconds even all attacking
Isn't it dependent on the vocation? Technically you "lose connection" to the game and there's a recent feature regarding it.
Isn't it dependent on the vocation... If the player is being attacked by another player and there are no attacking monsters left, it will remain online. If in case a monster is attacking it will disconnect.
@ranisalt
Edit: Sorry I'm using edited datapack...
my creature.lua in events is like:
function Creature:onTargetCombat(target)
if not self then
return true
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
return true
end
This bug is not relationed with the forgotten server.
Anyway, you need added checks if player have or not pzLocked. For it, you can use function: isPzLocked().
if target:isPzLocked() then
end
Most helpful comment
This bug is not relationed with the forgotten server.
Anyway, you need added checks if player have or not pzLocked. For it, you can use function: isPzLocked().
if target:isPzLocked() then end