• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Random item - TFS 1.x

tev

Banned User
Joined
Apr 19, 2013
Messages
113
Reaction score
6
You use X item and it will give you a random item with quantity.

Example:
I click 'use' in this item:
Golden_Newspaper.gif


It give me a random item that can be:
*5-30 crystal coins
*Mount doll
*1-2 Addon Doll, etc...

Thank you...

SOLVED
Thanks to SlayingWorld and strutZ!
 
Last edited:
Easy just use the script for suprise bag on your ot. and change the item ids.
Code:
local presents = {
    [6570] = { -- item id of the item that will give u random items
        {2687, 10}, {6394, 3}, 6280, 6574, 6578, 6575, 6577, 6569, 6576, 6572, 2114 --Setup the rewards here
    }
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local count = 1
    local targetItem = presents[item.itemid]
    if not targetItem then
        return true
    end

    local gift = targetItem[math.random(#targetItem)]
    if type(gift) == "table" then
        gift = gift[1]
        count = gift[2]
    end

    player:addItem(gift, count)
    item:remove(1)
    fromPosition:sendMagicEffect(CONST_ME_GIFT_WRAPS)
    return true
end
 
I didn't know. I'm sorry. Thank you!!

Easy just use the script for suprise bag on your ot. and change the item ids.
Code:
local presents = {
    [6570] = { -- item id of the item that will give u random items
        {2687, 10}, {6394, 3}, 6280, 6574, 6578, 6575, 6577, 6569, 6576, 6572, 2114 --Setup the rewards here
    }
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local count = 1
    local targetItem = presents[item.itemid]
    if not targetItem then
        return true
    end

    local gift = targetItem[math.random(#targetItem)]
    if type(gift) == "table" then
        gift = gift[1]
        count = gift[2]
    end

    player:addItem(gift, count)
    item:remove(1)
    fromPosition:sendMagicEffect(CONST_ME_GIFT_WRAPS)
    return true
end

Thank you!!! Have a nice day you both and thank you again. :)
 
Back
Top