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
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: