Beyond Sky
Weed is Life
What's the problem of this script.
I'm beginner on .LUA and i make this but i don't know solve it.
I'm beginner on .LUA and i make this but i don't know solve it.
Code:
function onSay(cid, words, param)
--[[Super Divines COMEÇO]]
local SuperDivine = {["super divine sword"]={7403}, ["super divine axe"]={8926}, ["super divine club"]={7423}, ["super divine staff"]={8922}, ["livro nivel 6"]={8921}, ["super divine crossbow"]={8851}}
local errocap = "Você não tem capacidade o suficiente para adquirir o item."
local errocust = "Você não tem 60 barras de ouro."
local erropar = "Este item não existe. Para acessar a lista de compras acesse o site em. www.megbr.com/?subtopic=shopping."
local sucess = "Compra efetuada com sucesso."
local param = string.lower(param)
if getItemWeightById(SuperDivine[param][1]) > getPlayerFreeCap(cid) then
if(getPlayerItemCount(cid, 9971) >= 60) then
if(param ~= "" and SuperDivine[param]) then
doPlayerRemoveItem(cid, 9971, 60)
doPlayerAddItem(cid, SuperDivine[param][1], 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, sucess)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, erropar)
return true
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, errocust)
return true
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, errocap)
return true
end
--[[Super Divines FIM]]
end
Erro TFS:
attempt to index field '?' <a nil value>
attempt to index field '?' <a nil value>