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

Lua Don't allow GM to get items from quest chests. downgrade nekiro 1.5 7.72

bpm91

Advanced OT User
Joined
May 23, 2019
Messages
1,046
Solutions
7
Reaction score
180
Location
Brazil
YouTube
caruniawikibr
As the title says, any ideas on how I can make level 4 = gamemaster players unable to open the chest?

LUA:
function onUse(cid, item, frompos, item2, topos)

    if getPlayerStorageValue(cid,8088) == -1 then
    doPlayerAddItem(cid,2143,1)
    setPlayerStorageValue(cid,8088,1)
    doPlayerSendTextMessage(cid,22,"You have found a white pearl.")
    return true
    end

    if getPlayerStorageValue(cid,8088) == 1 then
    doPlayerSendTextMessage(cid,22,"It's empty.")
    return true
    end

end
 
Can put the code at the top under onUse.. or you can put it around the spot where the player recieves the item.. if you want the gm's to be able to get the storage values but not the item.
LUA:
local player = cid -- assigning player as cid here, because you're using ancient code, for whatever reason
if player:getGroup():getAccess() then
    doPlayerSendTextMessage(cid, 22, "This player has GM level or greater access.")
    return true
end
 
ty xikini work 100%

blocked it for players too :/
Post automatically merged:

LUA:
function onUse(cid, item, frompos, item2, topos)
    local player = cid -- renaming cid here, because you're using ancient code, for whatever reason
    
    -- Verifica se o jogador é um GM
    if player:getAccountType() == ACCOUNT_TYPE_GAMEMASTER then
        doPlayerSendTextMessage(cid, 22, "This player has GM level access.")
        return true
    end
    
    if getPlayerStorageValue(cid,8088) == -1 then
    doPlayerAddItem(cid,2143,1)
    setPlayerStorageValue(cid,8088,1)
    doPlayerSendTextMessage(cid,22,"You have found a white pearl.")
    return true
    end

    if getPlayerStorageValue(cid,8088) == 1 then
    doPlayerSendTextMessage(cid,22,"It's empty.")
    return true
    end

end

work now, but ty for help <3
 
Last edited:
Back
Top