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

Browse field problem

bybbzan

mapper
Joined
Aug 4, 2012
Messages
809
Solutions
2
Reaction score
136
Location
Sweden
Hello!

Some players are steeling items that i put with otmapeditor, and put "something sparkling" above it.
They just to "browse field" and pick the item.

Is it possible to make a script were you can not browse field on certain positions?

Thanks in advance!
 
function Player:eek:nBrowseField(position)
return true
end

Edit it so it blocks those tiles.
 
Help for this problem??

i'm testes blok with
Code:
function Player:eek:nBrowseField(position)

    if isInArray({8047, 8046}, item:getId()) then
        self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
        return false
    end

    return true
end


dn't work :S
 
Help for this problem??

i'm testes blok with
Code:
function Player:eek:nBrowseField(position)

    if isInArray({8047, 8046}, item:getId()) then
        self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
        return false
    end

    return true
end


dn't work :S
any error in console?
 
I think that it is best to put uniqueid, but the function is Player: onBrowseField (without space, together it forms the smile :eek: or eek)
Thats why we use code tags :p
Code:
function Player:onBrowseField(position)

    if isInArray({8047, 8046}, item:getId()) then
        self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
    return false
    end

    return true
end
 
bumping this cuz I need this

item.getId() is nil. PlayerOnBrowseField only reads the position. I guess it would be possible for it to check what items there are on the position that the function gives us - would be cool if somneone could fix this!
 
Here you go.
Code:
function Player:onBrowseField(position)
    local items, item = Tile(position):getItems()
    for i = 1, #items do
        item = items[i]
        if isInArray({2160, 2152}, item:getId()) then
            self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
            return false
        end
    end
    return true
end
 
Back
Top