Coca Cola
New Member
- Joined
- Apr 10, 2010
- Messages
- 164
- Reaction score
- 0
hello everyone , i have an problem with this script and i belive the error is in refpower part.. could someone help? I can't fix that :/
ty,cya
ty,cya
Lua:
function onSay(cid, words, param)
local d = string.explode(param,",")
local itemid = tonumber(d[1])
local count = tonumber(d[2])
local refAtk = tonumber(d[3])
local refDef = tonumber(d[4])
local refPower = tonumber(d[5])
local Charges = tonumber(d[6])
local Armor = tonumber(d[7])
local HitChance = tonumber(d[8])
local Desc = tonumber(d[9])
if itemid ~= nil then
local uid = doPlayerAddItem(cid, itemid, count)
end
if refAtk ~= nil and refAtk > 0 then
doItemSetAttribute(uid,"attack",refAtk)
end
if refDef ~= nil and refDef > 0 then
doItemSetAttribute(uid,"defense",refDef)
end
if refPower ~= nil and refPower > 0 then
doItemSetAttribute(item.uid, 'name', getItemInfo(item.uid).name .. '[power+'..refPower..'points]')
end
if Charges ~= nil and Charges > 0 then
doItemSetAttribute(uid,"charges",Charges)
end
if Armor ~= nil and Armor > 0 then
doItemSetAttribute(uid,"armor",Armor)
end
if HitChance ~= nil and HitChance > 0 then
doItemSetAttribute(uid,"hitchance",HitChance)
end
if Desc ~= nil then
doItemSetAttribute(uid,"hitchance",HitChance)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'O item foi criado com sucesso.')
end
return TRUE
Last edited: