• 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

Advanced OT User
Joined
Oct 13, 2009
Messages
914
Solutions
6
Reaction score
155
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:
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
 
Back
Top