• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

HELP TILE LEVEL

115820

Member
Joined
Feb 27, 2011
Messages
193
Solutions
1
Reaction score
5
Location
London, England
I need a tile with LEVEL Permision. Only player with level 20 and 30 can pass, but if player have level 31 him cant pass in tile.
 
Should be somthing like this (Untested)

Code:
function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    local KICK_POS = Position(101, 116, 7) -- Change this to your cords
        if not player then
            return true
        end
       
        if not player:getLevel() == 20 or 30
                player:teleportTo(KICK_POS)
                player:say("I need to be level 20 or 30 to go in here.", TALKTYPE_MONSTER_SAY)
        return true
    end
 
I need a tile with LEVEL Permision. Only player with level 20 and 30 can pass, but if player have level 31 him cant pass in tile.

Code:
local levels = {20,30}

function onStepIn(creature, item, position, fromPosition)
    if not creature:isPlayer() then
        return true
    end
    if not isInArray(levels, creature:getLevel()) then
        creature:say("You need to be level "..table.concat(levels, ' or ') .. " to pass.", TALKTYPE_MONSTER_SAY)
        creature:teleportTo(fromPosition, true)
        return false
    end
    return true
end
 
Back
Top