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

Reward chest for tfs 1.2 ? 10.82

viking

Member
Joined
Aug 20, 2015
Messages
323
Reaction score
22
request for someone help me this? Left 4 scripts to me open otserver
 
Code:
local annihilatorReward = {1990, 2400, 2431, 2494}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.uid <= 1000 or item.uid > 22700 then
        return false
    end

    local itemType = ItemType(item.itemid)
    local itemWeight = itemType:getWeight()
    local playerCap = player:getFreeCapacity()
    if isInArray(annihilatorReward, item.uid) then
        if player:getStorageValue(30015) == -1 then
            if playerCap >= itemWeight then
                if item.uid == 1990 then
                    player:addItem(1990, 1):addItem(2326, 1)
                else
                    player:addItem(item.uid, 1)
                end
                player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. '.')
                player:setStorageValue(30015, 1)
            else
                player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
            end
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "It is empty.")
        end
    elseif player:getStorageValue(item.uid) == -1 then
        if playerCap >= itemWeight then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. '.')
            player:addItem(item.uid, 1)
            player:setStorageValue(item.uid, 1)
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
        end
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, "It is empty.")
    end
    return true
end

actions.xml
Code:
    <action itemid="1740" script="quests/quests.lua" />
    <action fromid="1747" toid="1749" script="quests/quests.lua" />
 
Code:
local annihilatorReward = {1990, 2400, 2431, 2494}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.uid <= 1000 or item.uid > 22700 then
        return false
    end

    local itemType = ItemType(item.itemid)
    local itemWeight = itemType:getWeight()
    local playerCap = player:getFreeCapacity()
    if isInArray(annihilatorReward, item.uid) then
        if player:getStorageValue(30015) == -1 then
            if playerCap >= itemWeight then
                if item.uid == 1990 then
                    player:addItem(1990, 1):addItem(2326, 1)
                else
                    player:addItem(item.uid, 1)
                end
                player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. '.')
                player:setStorageValue(30015, 1)
            else
                player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
            end
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "It is empty.")
        end
    elseif player:getStorageValue(item.uid) == -1 then
        if playerCap >= itemWeight then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. '.')
            player:addItem(item.uid, 1)
            player:setStorageValue(item.uid, 1)
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
        end
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, "It is empty.")
    end
    return true
end

actions.xml
Code:
    <action itemid="1740" script="quests/quests.lua" />
    <action fromid="1747" toid="1749" script="quests/quests.lua" />


Sorry, I did not explain myself . Looking reward chest when killed Bosses . thanks bro rep+
 
I have one for sale, if you interested.

Benefits of my reward chest system:
Calculates killers, healers and even blocker.
Different style or corpses and reward chest

If you wanna take a look on it pm me, or gimme a msg on skype [email protected]
 
Ye but I got some bugs like others in this post I was looking one more little code or like obujos chest (take random when kill boss)
man you can just setStorage with function onKill and make a action script, if the player have the storage then give him a reward '-' is easy..
 
Back
Top