I made this script that when a player opens the initial box he wins certain items
but I need all the items in the box to be unique items.
but the items are not coming as unique.
TFS 0.3
pokemon
but I need all the items in the box to be unique items.
but the items are not coming as unique.
TFS 0.3
pokemon
Lua:
local itens = {
{2394, 100},
{12349, 20},
{17179, 1},
{17180, 1},
}
local storage = 598
local level = 5
local pos = {x=1000, y=1002, z=7}
function onUse (cid,item,frompos,item2,topos)
if getPlayerLevel(cid) >= level then
if getPlayerStorageValue(cid, storage) == -1 then
doTeleportThing(cid,pos)
doPlayerSendTextMessage(cid, 22, "Parabens Voçe Ganhou Sua Box Inicial") -- Msg que ira aparecer
for i = 1, #itens do
doPlayerAddItem(cid, itens[i][1], itens[i][2])
end
setPlayerStorageValue(cid, storage, 1)
doSendMagicEffect(getThingPos(cid), 29)
doPlayerRemoveItem(cid, 10503, 1)
doSetItemAttribute(item.uid, "unique", itens(cid)) --- ??
else
doPlayerSendTextMessage(cid, 22, "Vazio.")
end
else
doPlayerSendCancel(cid,'Voçe Ja Ganhou Sua Box Inicial')
end
return true
end