• 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 What wrong on my another script?

RaikND

facebook.xenoria.org
Joined
May 12, 2010
Messages
942
Reaction score
10
Location
Spain
Not set "storageID":
LUA:
-- Script By RaikND, set StorageID Tile
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local cfg = {
      level = 30,  
	  storage = 30104,
	  textCompleted = "Ya tienes accesos para entrar a la Blue Djinn!",
	  cancelText = "Mission completada"
}

lvl = getPlayerLevel(cid)

if item.actionid == cfg.storage and lvl >= cfg.level == -1 then
getCreatureStorage(cid, cfg.storage)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, cfg.textCompleted)
setPlayerStorageValue(cid, cfg.storage, 1)
else
doPlayerSendCancel(cid, cfg.cancelText)
end
return true
end


thanks inadvance
 
LUA:
local cfg = {
      level = 30,  
      storage = 30104,
      textCompleted = 'Ya tienes accesos para entrar a la Blue Djinn!',
      cancelText = 'Mission completada'
}

-- Script By RaikND, set StorageID Tile
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if not isPlayer(cid) then
        return true
    end
    
    if getCreatureStorage(cid, cfg.storage) > -1 then
        doPlayerSendCancel(cid, cfg.cancelText)
        return true
    end
    
    if getPlayerLevel(cid) < cfg.level then
        doPlayerSendCancel(cid, 'No tienes el nivel minimo requerido['..cfg.level..']')
        return true
    end
    
    if item.actionid == cfg.storage then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, cfg.textCompleted)
        doCreatureSetStorage(cid, cfg.storage, 1)
    end
    return true
end
 
Back
Top