• 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 Help fast with marijuana script!

Moataz Hero

Titania.Sytes.Net
Joined
Jan 1, 2010
Messages
417
Reaction score
11
Location
Wars Land!
i need when they push lever the marijuana gone the item id 5953 please help when they push lever marijuana stays help!!! i need it gone and removed
there is the script
Code:
local config = {
    -- level needed to make the quest
    level = 15,

    -- if players should be able to do the quest unlimited amount of times (not conflicting quest rewards)
    redo = {
        status = false, -- true = unlimited, false = once
        storageValue = 61111 -- only if status is false this will be used
    },

    -- vocation requirement, positions and item configuration
    {
        vocations = {1, 5},
        itemId = 5953, 10,
        playerPos = {x=974, y=989, z=8}, -- Initial position in the Stone tile
        newPos = {x=919, y=1023, z=9}, -- Position of the reward room.
        itemPos = {x=975, y=989, z=8}  -- Position of Spellbook "Sorcerer".
    },

    {
        vocations = {2, 6},
        itemId = 5953, 10,
        playerPos = {x=966, y=989, z=8}, -- Initial position in the Stone tile
        newPos = {x=919, y=1024, z=9}, -- Position of the reward room.
        itemPos = {x=965, y=989, z=8} -- Position of Red apple "Druid".
    },

    {
        vocations = {3, 7},
        itemId = 5953, 10,
        playerPos = {x=970, y=985, z=8}, -- Initial position in the Stone tile
        newPos = {x=922, y=1023, z=9}, -- Position of the reward room.
        itemPos = {x=970, y=984, z=8} -- Position of Crossbow "Paladin".
    },

    {
        vocations = {4, 8},
        itemId = 5953, 10,
        playerPos = {x=970, y=993, z=8}, -- Initial position in the Stone tile
        newPos = {x=922, y=1024, z=9}, --Position of the reward room.
        itemPos = {x=970, y=994, z=8} --Position of Sword "Knight".
    }
}

function onUse(cid)
    local players = {}
    for _, v in ipairs(config) do

        v.playerPos.stackpos = 253
        local player = getThingfromPos(v.playerPos).uid

        if isPlayer(player) == FALSE then
            return doPlayerSendCancel(cid, "There are not enough players.")
        elseif getPlayerLevel(player) < config.level then
            players.level = true
        elseif isInArray(v.vocations, getPlayerVocation(player)) == FALSE then
            players.vocation = true
        elseif config.redo.status and getPlayerStorageValue(cid, config.redo.storageValue) ~= TRUE then
            players.done = true
        else
            v.itemPos.stackpos = 1
            local item = getThingfromPos(v.itemPos)

            if item.itemid ~= v.itemId then
                players.item = true
            else
                table.insert(players, player)
            end
        end
    end

    if players.level then
        doPlayerSendCancel(cid, "All players need to be level " .. config.level .. " or above.")
    elseif players.vocation then
        doPlayerSendCancel(cid, "All players must stand on the correct tiles.")
    elseif players.done then
        doPlayerSendCancel(cid, "A player in your team has already done this quest.")
    elseif players.item then
        doPlayerSendCancel(cid, "All items must be on the correct positions.")
    else
        for k, player in ipairs(players) do
            doSendMagicEffect(getCreaturePosition(player), CONST_ME_POFF)
            doTeleportThing(player, config[k].newPos)
            doSendMagicEffect(getCreaturePosition(player), CONST_ME_TELEPORT)
        end
    end

    return TRUE
end
 
Last edited by a moderator:
PHP:
local config = {
-- level needed to make the quest
level = 15,

-- if players should be able to do the quest unlimited amount of times (not conflicting quest rewards)
redo = {
status = false, -- true = unlimited, false = once
storageValue = 61111 -- only if status is false this will be used
},

-- vocation requirement, positions and item configuration
{
vocations = {1, 5},
itemId = 5953, 10,
playerPos = {x=974, y=989, z=8}, -- Initial position in the Stone tile
newPos = {x=919, y=1023, z=9}, -- Position of the reward room.
itemPos = {x=975, y=989, z=8} -- Position of Spellbook "Sorcerer".
},

{
vocations = {2, 6},
itemId = 5953, 10,
playerPos = {x=966, y=989, z=8}, -- Initial position in the Stone tile
newPos = {x=919, y=1024, z=9}, -- Position of the reward room.
itemPos = {x=965, y=989, z=8} -- Position of Red apple "Druid".
},

{
vocations = {3, 7},
itemId = 5953, 10,
playerPos = {x=970, y=985, z=8}, -- Initial position in the Stone tile
newPos = {x=922, y=1023, z=9}, -- Position of the reward room.
itemPos = {x=970, y=984, z=8} -- Position of Crossbow "Paladin".
},

{
vocations = {4, 8},
itemId = 5953, 10,
playerPos = {x=970, y=993, z=8}, -- Initial position in the Stone tile
newPos = {x=922, y=1024, z=9}, --Position of the reward room.
itemPos = {x=970, y=994, z=8} --Position of Sword "Knight".
}
}

function onUse(cid, item, frompos, item2, topos)
local players = {}
for _, v in ipairs(config) do

v.playerPos.stackpos = 253
local player = getThingfromPos(v.playerPos).uid

if isPlayer(player) == FALSE then
return doPlayerSendCancel(cid, "There are not enough players.")
elseif getPlayerLevel(player) < config.level then
players.level = true
elseif isInArray(v.vocations, getPlayerVocation(player)) == FALSE then
players.vocation = true
elseif config.redo.status and getPlayerStorageValue(cid, config.redo.storageValue) ~= TRUE then
players.done = true
else
v.itemPos.stackpos = 1
local item = getThingfromPos(v.itemPos)

if item.itemid ~= v.itemId then
players.item = true
else
table.insert(players, player)
end
end
end

if players.level then
doPlayerSendCancel(cid, "All players need to be level " .. config.level .. " or above.")
elseif players.vocation then
doPlayerSendCancel(cid, "All players must stand on the correct tiles.")
elseif players.done then
doPlayerSendCancel(cid, "A player in your team has already done this quest.")
elseif players.item then
doPlayerSendCancel(cid, "All items must be on the correct positions.")
else
for k, player in ipairs(players) do
doSendMagicEffect(getCreaturePosition(player), CONST_ME_POFF)
doTeleportThing(player, config[k].newPos)
doRemoveItem(item.uid, 1)
doSendMagicEffect(getCreaturePosition(player), CONST_ME_TELEPORT)
end
end

return TRUE
end

Try this :p
 
@Moataz Hero

1. Did you use the right cordinates?
2. Is there 1 player of every vocation on the right tile?
3. Is there "10 marijuana" on every 4 the tiles?
4. Does it give any error when your using the lever?
5. Did any of the 4 players do the quest before?

Is it a script that you found on otland? If it is send me the link
 
1- yes
Code:
local config = {
-- level needed to make the quest
level = 15,

-- if players should be able to do the quest unlimited amount of times (not conflicting quest rewards)
redo = {
status = false, -- true = unlimited, false = once
storageValue = 61111 -- only if status is false this will be used
},

-- vocation requirement, positions and item configuration
{
vocations = {1, 5},
itemId = 5953, 10,
playerPos = {x=974, y=989, z=8}, -- Initial position in the Stone tile
newPos = {x=919, y=1023, z=9}, -- Position of the reward room.
itemPos = {x=975, y=989, z=8} -- Position of Spellbook "Sorcerer".
},

{
vocations = {2, 6},
itemId = 5953, 10,
playerPos = {x=966, y=989, z=8}, -- Initial position in the Stone tile
newPos = {x=919, y=1024, z=9}, -- Position of the reward room.
itemPos = {x=965, y=989, z=8} -- Position of Red apple "Druid".
},

{
vocations = {3, 7},
itemId = 5953, 10,
playerPos = {x=970, y=985, z=8}, -- Initial position in the Stone tile
newPos = {x=922, y=1023, z=9}, -- Position of the reward room.
itemPos = {x=970, y=984, z=8} -- Position of Crossbow "Paladin".
},

{
vocations = {4, 8},
itemId = 5953, 10,
playerPos = {x=970, y=993, z=8}, -- Initial position in the Stone tile
newPos = {x=922, y=1024, z=9}, --Position of the reward room.
itemPos = {x=970, y=994, z=8} --Position of Sword "Knight".
}
}

function onUse(cid)
local players = {}
for _, v in ipairs(config) do

v.playerPos.stackpos = 253
local player = getThingfromPos(v.playerPos).uid

if isPlayer(player) == FALSE then
return doPlayerSendCancel(cid, "There are not enough players.")
elseif getPlayerLevel(player) < config.level then
players.level = true
elseif isInArray(v.vocations, getPlayerVocation(player)) == FALSE then
players.vocation = true
elseif config.redo.status and getPlayerStorageValue(cid, config.redo.storageValue) ~= TRUE then
players.done = true
else
v.itemPos.stackpos = 1
local item = getThingfromPos(v.itemPos)

if item.itemid ~= v.itemId then
players.item = true
else
table.insert(players, player)
end
end
end

if players.level then
doPlayerSendCancel(cid, "All players need to be level " .. config.level .. " or above.")
elseif players.vocation then
doPlayerSendCancel(cid, "All players must stand on the correct tiles.")
elseif players.done then
doPlayerSendCancel(cid, "A player in your team has already done this quest.")
elseif players.item then
doPlayerSendCancel(cid, "All items must be on the correct positions.")
else
for k, player in ipairs(players) do
doSendMagicEffect(getCreaturePosition(player), CONST_ME_POFF)
doTeleportThing(player, config[k].newPos)
doSendMagicEffect(getCreaturePosition(player), CONST_ME_TELEPORT)
end
end

return TRUE
end
2- yes
3- no
4- no
5- no
the script here is it
 
Last edited by a moderator:
this script is for desert quest (also known as 10k quest) where you need lvl 20 and atleast 4 players (1 knight, 1 sorc, 1 paladin, 1 druid) so it works like that.
You need 4 players to stand on the tiles and every player needs to put the items on the right tile only then you will get teleported after using the lever
 
Back
Top