• 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!

Check elevation OTCV8 OR MEHAH

johnsamir

Active Member
Joined
Oct 13, 2009
Messages
232
Solutions
1
Reaction score
35
Location
Nowhere
Hello. I have added block parcel code into my sources, but know i need to check the elevation in the client which is not being checked at all. A guy in this forum gave me a code, but it doesn't work. Also with this code i can't walk with arrow keys don't know why.

this is the code. Can comebody help me out please?
Lua:
    local playerTile = player:getTile()
 if (playerTile and (toTile:hasElevation() - playerTile:hasElevation() <= 1) or (playerTile:hasElevation() > 3))
      player:preWalk(dir)
      preWalked = true
      else player:lockWalk(100)
      end
 
Last edited:

Terotrificy

Well-Known Member
Joined
Oct 18, 2020
Messages
231
Solutions
9
Reaction score
75
Location
Santiago, Chile.
Lua:
 nextWalkDir = nil
  removeEvent(autoWalkEvent)
  autoWalkEvent = nil
  local preWalked = false
  local playerTile = player:getTile()
   if toTile and toTile:isWalkable() then
    if not player:isServerWalking() and not ignoredCanWalk then
        if (playerTile and (toTile:getElevation() - playerTile:getElevation() <= 1) or (playerTile:getElevation() > 3)) then
            player:preWalk(dir)
            preWalked = true
        end
    end
  else
    local playerTile = player:getTile()
    if (playerTile and playerTile:hasElevation(3) and canChangeFloorUp(toPos)) or canChangeFloorDown(toPos) or (toTile and toTile:isEmpty() and not toTile:isBlocking()) then
      player:lockWalk(100)
    elseif player:isServerWalking() then
      g_game.stop()
      return
    elseif not toTile then
      player:lockWalk(100) -- bug fix for missing stairs down on map
    else
      if g_app.isMobile() and dir <= Directions.West then
        turn(dir, ticks > 0)
      end
      return -- not walkable tile
    end
  end
 
Top