ralke
(҂ ͠❛ ෴ ͡❛)ᕤ
Hi! I don't know what i'm doing wrong here. I already managed to add atributes to items from chests (onUse), and other NPCs too, but in this case, it doesn't let me add the roll atribute that comes from other system (oen's upgrade system). For this I tried:
And for some reason, this line
is returning me a nil value on itemType. Why is that happening? Tried to define itemType as local variable but couldn't make it work.
Thanks in advance!
Solved with
Or commenting this from oen's system (I don't use upgradable or unique items, so, I think this line can be gone)
Lua:
local function addFocus(cid)
choice[cid] = nil
return true
end
local function releaseFocus(cid)
choice[cid] = nil
return true
end
local function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
end
local player = Player(cid)
local price_vortex = 500
if msgcontains(msg, "vortice") or msgcontains(msg, "vortex") then
npcHandler:say("Puedo hacer una varita de vortice. ¿Quieres comerciar?", cid)
npcHandler.topic[cid] = 1
elseif msgcontains(msg, "yes") or msgcontains(msg, "si") and npcHandler.topic[cid] == 1 then
if player:removeMoney(price_vortex) then
npcHandler:say("Aquí tienes.", cid)
--player:addItem(6529, 6)
local vortexItem = player:addItem(2190,1)
vortexItem:setItemLevel(8, false)
vortexItem:setRarity(COMMON)
vortexItem:rollAttribute(player, itemType, weaponType, true)
else
npcHandler:say("No tienes suficiente dinero contigo.", cid)
end
npcHandler.topic[cid] = 0
end
return true
end
And for some reason, this line
Lua:
vortexItem:rollAttribute(player, itemType, weaponType, true)
Thanks in advance!
Post automatically merged:
Solved with
Lua:
vortexItem:rollAttribute(player, vortexItem:getType(), vortexItem:getType():getWeaponType(), true)
Or commenting this from oen's system (I don't use upgradable or unique items, so, I think this line can be gone)
Lua:
if not itemType:isUpgradable() or self:isUnique() then
return false
end
Last edited: