• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

How fix expdoors of avesta?

Felipe93

Ghost Member
Joined
Mar 21, 2015
Messages
1,990
Solutions
9
Reaction score
334
Location
Chile
Hello when i try to open a expdoor everything is okey but when its closse the server freeze and
get alots of exe errors
anyone how fyx any code or something?
please and thanks
 
sorry here is the picture of the erro show in console exe https://imgur.com/YqY20iD

the code of my expdoorclosed
Code:
-------------------------------------
-- ActionIDs:
-- 1001~1999: Level doors(level is actionID-1000)
-- 2001~2008: Vocation doors(voc is ActionID-2000. 1:Sorcerer, 2:Druid, 3:paladin, 4:Knight, 5:MS, 6:ED, 7:RP, 8:EK)

function onUse(cid, item, frompos, item2, topos)
  reqlevel = item.actionid - 1000
   local isLevelDoor = (item.actionid >= 1001 and item.actionid <= 1999)
   local isVocationDoor = (item.actionid >= 2001 and item.actionid <= 2008)

   if not(isLevelDoor or isVocationDoor) then
     -- Make it a normal door
     doTransformItem(item.uid, item.itemid+1)
     return TRUE
   end

   local canEnter = true
   if(isLevelDoor and getPlayerLevel(cid) < (item.actionid-1000)) then
     canEnter = false
   end

   if(isVocationDoor) then
     local doorVoc = item.actionid-2000
     if (doorVoc == 1 and not(isSorcerer(cid))) or
      (doorVoc == 2 and not(isDruid(cid)))  or
      (doorVoc == 3 and not(isPaladin(cid)))  or
      (doorVoc == 4 and not(isKnight(cid)))  or
      (doorVoc ~= getPlayerVocation(cid))  then
       canEnter = false
     end
   end

   if not(canEnter) then
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
     return TRUE
   end
  
   if getPlayerLevel(cid) >= reqlevel then
   doTransformItem(item.uid, item.itemid+1)
   local canGo = (queryTileAddThing(cid, frompos, bit.bor(2, 4)) == RETURNVALUE_NOERROR) --Veryfies if the player can go, ignoring blocking things
   if not(canGo) then
     return FALSE
   end

   local dir = getDirectionTo(getPlayerPosition(cid), frompos)
   doMoveCreature(cid, dir)
   return TRUE
end
end

thanks in advance
 
Last edited by a moderator:
Code:
-- ActionIDs:
-- 1001~1999: Level doors(level is actionID-1000)
-- 2001~2008: Vocation doors(voc is ActionID-2000. 1:Sorcerer, 2:Druid, 3:paladin, 4:Knight, 5:MS, 6:ED, 7:RP, 8:EK)

function onUse(cid, item, frompos, item2, topos)
    local isLevelDoor = (item.actionid >= 1001 and item.actionid <= 1999)
    local isVocationDoor = (item.actionid >= 2001 and item.actionid <= 2008)

   
if item.actionid >= 1001 and item.actionid <= 1999 then   
    if getPlayerLevel(cid) >= item.actionid-1000 then
    doTransformItem(item.uid, item.itemid+1)
    topos = {x=topos.x, y=topos.y, z=topos.z}
    doTeleportThing(cid,topos)
    else
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
    end
   
elseif item.actionid >= 2001 and item.actionid <= 2008 then
    if item.actionid == 2001 then
    if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 then
    maypass = true
    end
    elseif item.actionid == 2002 then
    if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 then
    maypass = true
    end
    elseif item.actionid == 2003 then
    if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
    maypass = true
    end
    elseif item.actionid == 2004 then
    if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
    maypass = true
    end
    elseif item.actionid == 2005 then
    if getPlayerVocation(cid) == 5 then
    maypass = true
    end
    elseif item.actionid == 2006 then
    if getPlayerVocation(cid) == 6 then
    maypass = true
    end
    elseif item.actionid == 2007 then
    if getPlayerVocation(cid) == 7 then
    maypass = true
    end
    elseif item.actionid == 2008 then
    if getPlayerVocation(cid) == 8 then
    maypass = true
    end
    else
    maypass = false
    end
   
   
   
    if (maypass == true) then
    doTransformItem(item.uid, item.itemid+1)
    topos = {x=topos.x, y=topos.y, z=topos.z}
    doTeleportThing(cid,topos)
    else
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your vocation are not allowed to pass this door!")
    end
   
end


    local canGo = (queryTileAddThing(cid, frompos, bit.bor(2, 4)) == RETURNVALUE_NOERROR) --Veryfies if the player can go, ignoring blocking things
    if not(canGo) then
        return FALSE
    end
   
    return TRUE
end
 
Last edited by a moderator:
Code:
-- ActionIDs:
  -- 1001~1999: Level doors(level is actionID-1000)
  -- 2001~2008: Vocation doors(voc is ActionID-2000. 1:Sorcerer, 2:Druid, 3:paladin, 4:Knight, 5:MS, 6:ED, 7:RP, 8:EK)

  function onUse(cid, item, frompos, item2, topos)
  local isLevelDoor = (item.actionid >= 1001 and item.actionid <= 1999)
  local isVocationDoor = (item.actionid >= 2001 and item.actionid <= 2008)


  if item.actionid >= 1001 and item.actionid <= 1999 then
  if getPlayerLevel(cid) >= item.actionid-1000 then
  doTransformItem(item.uid, item.itemid+1)
  topos = {x=topos.x, y=topos.y, z=topos.z}
  doTeleportThing(cid,topos)
  else
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
  end

  elseif item.actionid >= 2001 and item.actionid <= 2008 then
  if item.actionid == 2001 then
  if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 then
  maypass = true
  end
  elseif item.actionid == 2002 then
  if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 then
  maypass = true
  end
  elseif item.actionid == 2003 then
  if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
  maypass = true
  end
  elseif item.actionid == 2004 then
  if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
  maypass = true
  end
  elseif item.actionid == 2005 then
  if getPlayerVocation(cid) == 5 then
  maypass = true
  end
  elseif item.actionid == 2006 then
  if getPlayerVocation(cid) == 6 then
  maypass = true
  end
  elseif item.actionid == 2007 then
  if getPlayerVocation(cid) == 7 then
  maypass = true
  end
  elseif item.actionid == 2008 then
  if getPlayerVocation(cid) == 8 then
  maypass = true
  end
  else
  maypass = false
  end

the expgateclosedoor here is

  if (maypass == true) then
  doTransformItem(item.uid, item.itemid+1)
  topos = {x=topos.x, y=topos.y, z=topos.z}
  doTeleportThing(cid,topos)
  else
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your vocation are not allowed to pass this door!")
  end

  end


  local canGo = (queryTileAddThing(cid, frompos, bit.bor(2, 4)) == RETURNVALUE_NOERROR) --Veryfies if the player can go, ignoring blocking things
  if not(canGo) then
  return FALSE
  end

  return TRUE
  end
 
Last edited by a moderator:
Why don't you use default files?

-- ActionIDs:
-- 1001~1999: Level doors(level is actionID-1000)
-- 2001~2008: Vocation doors(voc is ActionID-2000. 1:Sorcerer, 2:Druid, 3:paladin, 4:Knight, 5:MS, 6:ED, 7:RP, 8:EK)

function onUse(cid, item, frompos, item2, topos)
local isLevelDoor = (item.actionid >= 1001 and item.actionid <= 1999)
local isVocationDoor = (item.actionid >= 2001 and item.actionid <= 2008)


if item.actionid >= 1001 and item.actionid <= 1999 then
if getPlayerLevel(cid) >= item.actionid-1000 then
doTransformItem(item.uid, item.itemid+1)
topos = {x=topos.x, y=topos.y, z=topos.z}
doTeleportThing(cid,topos)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
end

elseif item.actionid >= 2001 and item.actionid <= 2008 then
if item.actionid == 2001 then
if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 then
maypass = true
end
elseif item.actionid == 2002 then
if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 then
maypass = true
end
elseif item.actionid == 2003 then
if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
maypass = true
end
elseif item.actionid == 2004 then
if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
maypass = true
end
elseif item.actionid == 2005 then
if getPlayerVocation(cid) == 5 then
maypass = true
end
elseif item.actionid == 2006 then
if getPlayerVocation(cid) == 6 then
maypass = true
end
elseif item.actionid == 2007 then
if getPlayerVocation(cid) == 7 then
maypass = true
end
elseif item.actionid == 2008 then
if getPlayerVocation(cid) == 8 then
maypass = true
end
else
maypass = false
end

the expgateclosedoor here is

if (maypass == true) then
doTransformItem(item.uid, item.itemid+1)
topos = {x=topos.x, y=topos.y, z=topos.z}
doTeleportThing(cid,topos)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your vocation are not allowed to pass this door!")
end

end


local canGo = (queryTileAddThing(cid, frompos, bit.bor(2, 4)) == RETURNVALUE_NOERROR) --Veryfies if the player can go, ignoring blocking things
if not(canGo) then
return FALSE
end

return TRUE
end

That can't be your movement script for closing doors, since it's a action script for opening vocation doors.
 
Last edited:
Hiho @Peonso
i don't use default one's cause my server is so mixed with others.. and i was reading avesta doors default files never were working
u think with that closing door lua it's will work ? i can show you my files
pm pls
thanks for u time
 
doors are "woring " now got no server crash when use them but them don't close once used i have to re-click to close them
any idea?
thanks to all

C:\Users\ClAUI\Desktop\Avesta OS(perfect)\data\movements\scripts << clossing door
Code:
  -- ActionIDs:
  -- 1001~1999: Level doors(level is actionID-1000)
  -- 2001~2008: Vocation doors(voc is ActionID-2000. 1:Sorcerer, 2:Druid, 3:paladin, 4:Knight, 5:MS, 6:ED, 7:RP, 8:EK)

  function onUse(cid, item, frompos, item2, topos)
  local isLevelDoor = (item.actionid >= 1001 and item.actionid <= 1999)
  local isVocationDoor = (item.actionid >= 2001 and item.actionid <= 2008)


  if item.actionid >= 1001 and item.actionid <= 1999 then
  if getPlayerLevel(cid) >= item.actionid-1000 then
  doTransformItem(item.uid, item.itemid+1)
  topos = {x=topos.x, y=topos.y, z=topos.z}
  doTeleportThing(cid,topos)
  else
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
  end

  elseif item.actionid >= 2001 and item.actionid <= 2008 then
  if item.actionid == 2001 then
  if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 then
  maypass = true
  end
  elseif item.actionid == 2002 then
  if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 then
  maypass = true
  end
  elseif item.actionid == 2003 then
  if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
  maypass = true
  end
  elseif item.actionid == 2004 then
  if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
  maypass = true
  end
  elseif item.actionid == 2005 then
  if getPlayerVocation(cid) == 5 then
  maypass = true
  end
  elseif item.actionid == 2006 then
  if getPlayerVocation(cid) == 6 then
  maypass = true
  end
  elseif item.actionid == 2007 then
  if getPlayerVocation(cid) == 7 then
  maypass = true
  end
  elseif item.actionid == 2008 then
  if getPlayerVocation(cid) == 8 then
  maypass = true
  end
  else
  maypass = false
  end

  the expgateclosedoor here is

  if (maypass == true) then
  doTransformItem(item.uid, item.itemid+1)
  topos = {x=topos.x, y=topos.y, z=topos.z}
  doTeleportThing(cid,topos)
  else
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your vocation are not allowed to pass this door!")
  end

  end


  local canGo = (queryTileAddThing(cid, frompos, bit.bor(2, 4)) == RETURNVALUE_NOERROR) --Veryfies if the player can go, ignoring blocking things
  if not(canGo) then
  return FALSE
  end

  return TRUE
  end
 
Last edited by a moderator:
https://imgur.com/jCYWfQ1
i chnage the doors of avesta for othire not all just
onadd_gateofexp.lua
onadd_lockeddoor.lua
onadd_questdoor.lua
inC:\Users\Slim\Desktop\Avesta OS(perfect)\data\movements\scripts
and
C:\Users\Slim\Desktop\Avesta OS(perfect)\data\actions\scripts\doors
now expgate doors are not crashing the sevrer but i have to re-click to close
any idea? thanks in advance
its recompile avesta 7.4
Bump !
 
Back
Top