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

Solved Lottery Ticket

denkan97

Well-Known Member
Joined
Dec 27, 2011
Messages
327
Solutions
2
Reaction score
50
Would like some help here to make this script so when i use this item (id 5957).
Then i get a 25% chance to get one item and/or 10% chance to get another.

TFS 1.2

Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if math.random(50) == 1 then
        player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS)
        player:say("Congratulations! You won a prize!", TALKTYPE_MONSTER_SAY)
        item:transform(5958)
     
    else
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
        player:say("Sorry, but you drew a blank.", TALKTYPE_MONSTER_SAY)
        item:remove(1)
    end
    return true
end
 
Last edited by a moderator:
Back
Top