• 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 Arena Rewards

Felipe Monteiro

Webmaster
Joined
Feb 27, 2009
Messages
460
Reaction score
59
Location
Brasil
I have some erros in arena globet, i'm using tfs 1.0

First error with the function doItemSetAttribute

Code:
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/arenagoblet.lua:onStepIn
data/movements/scripts/arenagoblet.lua:7: attempt to call global 'doItemSetAttri
bute' (a nil value)
stack traceback:
        [C]: in function 'doItemSetAttribute'
        data/movements/scripts/arenagoblet.lua:7: in function <data/movements/sc
ripts/arenagoblet.lua:1>

Second error with my arena rewards

When i open chest it says "You found "

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.actionid >= 42361 and item.actionid <= 42365 and getPlayerStorageValue(cid, 42361) ~= 1 then
        local reward = 0
        if item.actionid == 42361 then
            reward = doCreateItemEx(1990,1)
            doAddContainerItem(reward, 7372, 1)
            doAddContainerItem(reward, 6569, 10)
            doAddContainerItem(reward, 6574, 1)
            doAddContainerItem(reward, 2114, 1)
        elseif item.actionid == 42362 then
            reward = doCreateItemEx(7406,1)
        elseif item.actionid == 42363 then
            reward = doCreateItemEx(7380,1)
        elseif item.actionid == 42364 then
            reward = doCreateItemEx(7392,1)
        elseif item.actionid == 42365 then
            reward = doCreateItemEx(7342,1)
            doAddContainerItem(reward, 7365, 100)
            doAddContainerItem(reward, 7364, 100)
        end
        if doPlayerAddItemEx(cid, reward, 0) == RETURNVALUE_NOERROR then
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You found ' .. getItemName(getThing(reward).uid) .. '.')
            setPlayerStorageValue(cid, 42361, 1)
        else
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You do not have enought capacity or place in backpack.')
        end
    elseif item.actionid >= 42371 and item.actionid <= 42375 and getPlayerStorageValue(cid, 42371) ~= 1 then
        local reward = 0
        if item.actionid == 42371 then
            reward = doCreateItemEx(1990,1)
            doAddContainerItem(reward, 7372, 1)
            doAddContainerItem(reward, 6569, 10)
            doAddContainerItem(reward, 6574, 1)
            doAddContainerItem(reward, 7183, 1)
        elseif item.actionid == 42372 then
            reward = doCreateItemEx(7384,1)
        elseif item.actionid == 42373 then
            reward = doCreateItemEx(7389,1)
        elseif item.actionid == 42374 then
            reward = doCreateItemEx(7415,1)
        elseif item.actionid == 42375 then
            reward = doCreateItemEx(7342,1)
            doAddContainerItem(reward, 7365, 100)
            doAddContainerItem(reward, 2547, 100)
            doAddContainerItem(reward, 2547, 100)
            doAddContainerItem(reward, 2311, 50)
            doAddContainerItem(reward, 2304, 50)
        end
        if doPlayerAddItemEx(cid, reward, 0) == RETURNVALUE_NOERROR then
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You found ' .. getItemName(getThing(reward).uid) .. '.')
            setPlayerStorageValue(cid, 42371, 1)
        else
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You do not have enought capacity or place in backpack.')
        end
    elseif item.actionid >= 42381 and item.actionid <= 42385 and getPlayerStorageValue(cid, 42381) ~= 1 then
        local reward = 0
        if item.actionid == 42381 then
            reward = doCreateItemEx(1990,1)
            doAddContainerItem(reward, 7372, 1)
            doAddContainerItem(reward, 6569, 10)
            doAddContainerItem(reward, 6574, 1)
            doAddContainerItem(reward, 5080, 1)
        elseif item.actionid == 42382 then
            reward = doCreateItemEx(7390,1)
        elseif item.actionid == 42383 then
            reward = doCreateItemEx(7434,1)
        elseif item.actionid == 42384 then
            reward = doCreateItemEx(7429,1)
        elseif item.actionid == 42385 then
            reward = doCreateItemEx(7342,1)
            doAddContainerItem(reward, 2273, 50)
            doAddContainerItem(reward, 2268, 50)
            doAddContainerItem(reward, 7443, 1)
            doAddContainerItem(reward, 7440, 1)
            doAddContainerItem(reward, 6529, 100)
        end
        if doPlayerAddItemEx(cid, reward, 0) == RETURNVALUE_NOERROR then
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You found ' .. getItemName(getThing(reward).uid) .. '.')
            setPlayerStorageValue(cid, 42381, 1)
        else
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You do not have enought capacity or place in backpack.')
        end
    end
    return TRUE
end

if someone can help me :D
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.actionid >= 42361 and item.actionid <= 42365 and getPlayerStorageValue(cid, 42361) ~= 1 then
        local reward = 0
        if item.actionid == 42361 then
            reward = doCreateItemEx(1990,1)
            doAddContainerItem(reward, 7372, 1)
            doAddContainerItem(reward, 6569, 10)
            doAddContainerItem(reward, 6574, 1)
            doAddContainerItem(reward, 2114, 1)
        elseif item.actionid == 42362 then
            reward = doCreateItemEx(7406,1)
        elseif item.actionid == 42363 then
            reward = doCreateItemEx(7380,1)
        elseif item.actionid == 42364 then
            reward = doCreateItemEx(7392,1)
        elseif item.actionid == 42365 then
            reward = doCreateItemEx(7342,1)
            doAddContainerItem(reward, 7365, 100)
            doAddContainerItem(reward, 7364, 100)
        end
        if doPlayerAddItemEx(cid, reward, 0) == RETURNVALUE_NOERROR then
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You found ' .. getItemNameById(reward) .. '.')
            setPlayerStorageValue(cid, 42361, 1)
        else
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You do not have enought capacity or place in backpack.')
        end
    elseif item.actionid >= 42371 and item.actionid <= 42375 and getPlayerStorageValue(cid, 42371) ~= 1 then
        local reward = 0
        if item.actionid == 42371 then
            reward = doCreateItemEx(1990,1)
            doAddContainerItem(reward, 7372, 1)
            doAddContainerItem(reward, 6569, 10)
            doAddContainerItem(reward, 6574, 1)
            doAddContainerItem(reward, 7183, 1)
        elseif item.actionid == 42372 then
            reward = doCreateItemEx(7384,1)
        elseif item.actionid == 42373 then
            reward = doCreateItemEx(7389,1)
        elseif item.actionid == 42374 then
            reward = doCreateItemEx(7415,1)
        elseif item.actionid == 42375 then
            reward = doCreateItemEx(7342,1)
            doAddContainerItem(reward, 7365, 100)
            doAddContainerItem(reward, 2547, 100)
            doAddContainerItem(reward, 2547, 100)
            doAddContainerItem(reward, 2311, 50)
            doAddContainerItem(reward, 2304, 50)
        end
        if doPlayerAddItemEx(cid, reward, 0) == RETURNVALUE_NOERROR then
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You found ' ..getItemNameById(reward).. '.')
            setPlayerStorageValue(cid, 42371, 1)
        else
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You do not have enought capacity or place in backpack.')
        end
    elseif item.actionid >= 42381 and item.actionid <= 42385 and getPlayerStorageValue(cid, 42381) ~= 1 then
        local reward = 0
        if item.actionid == 42381 then
            reward = doCreateItemEx(1990,1)
            doAddContainerItem(reward, 7372, 1)
            doAddContainerItem(reward, 6569, 10)
            doAddContainerItem(reward, 6574, 1)
            doAddContainerItem(reward, 5080, 1)
        elseif item.actionid == 42382 then
            reward = doCreateItemEx(7390,1)
        elseif item.actionid == 42383 then
            reward = doCreateItemEx(7434,1)
        elseif item.actionid == 42384 then
            reward = doCreateItemEx(7429,1)
        elseif item.actionid == 42385 then
            reward = doCreateItemEx(7342,1)
            doAddContainerItem(reward, 2273, 50)
            doAddContainerItem(reward, 2268, 50)
            doAddContainerItem(reward, 7443, 1)
            doAddContainerItem(reward, 7440, 1)
            doAddContainerItem(reward, 6529, 100)
        end
        if doPlayerAddItemEx(cid, reward, 0) == RETURNVALUE_NOERROR then
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You found ' .. getItemNameById(reward) .. '.')
            setPlayerStorageValue(cid, 42381, 1)
        else
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You do not have enought capacity or place in backpack.')
        end
    end
    return TRUE
end

try This one
 
Last edited:
I have fixed ! Thank u anyway !

I have changed this
Code:
' .. getItemName(getThing(reward).uid) .. '

for this

Code:
' .. getItemName(getThing(reward).itemid) .. '
 
Last edited:
Back
Top