Hey guys! I tried but none solution till the moment.
If the event is CLOSED it runs fine (return your guild is not the owner of the castle, you are not in a guild and the event is closed only castle owners have access) but if the event START the (you are not in a guild) get ignored and it calls registerToCastle(). Who can save me? Thanks
If the event is CLOSED it runs fine (return your guild is not the owner of the castle, you are not in a guild and the event is closed only castle owners have access) but if the event START the (you are not in a guild) get ignored and it calls registerToCastle(). Who can save me? Thanks
Lua:
function onStepIn(creature, item, pos, fromPosition)
if Game.getStorageValue(37895) == nil then Game.setStorageValue(37895, 0) end
if (creature:isPlayer()) then
if (getCastleEventStatus() <= EVENT_CLOSED) then
if (castleOwner > 0) then
local guild = creature:getGuild()
if (guild) then
if (guild:getId() ~= castleOwner) then
creature:teleportTo(fromPosition)
creature:sendCancelMessage('Your guild is not the owner of the Castle.')
end
else
creature:teleportTo(fromPosition)
creature:sendCancelMessage('You are not in a guild.')
end
else
creature:teleportTo(fromPosition)
creature:sendCancelMessage('The event is closed. Only castle owners have access.')
end
else
creature:registerToCastle()
end
end
return true
end