seria isso amigo?
function onSay(cid, words, param)
local t = {
["nightmare doll"] = {item ={117,1},points = 90},
["sd"] = {item ={2268,100},points = 10}
}
local param,str = string.lower(param),""
if param == "" then
doPlayerSendTextMessage(cid, 27, "Voce possui "..getPoints(cid).." creditos.") return true
elseif param == 'lista' then
for name, x in pairs(t) do
str = str.."\nItem: "..name.." -> Price: [" ..x.points.."]"
end
doShowTextDialog(cid, 2529, str) return true
end
local buy = t[param]
if not(buy) then
doPlayerSendTextMessage(cid, 22, "desculpe, mas este não existe, digite !comando lista") return true
elseif getPoints(cid) < buy.points then
doPlayerSendTextMessage(cid, 22, "desculpe, mas você precisa de "..buy.points.." points para comprar o "..param) return true
end
doPlayerAddItem(cid, buy.item[1],buy.item[2])
removePoints(cid,buy.points)
doPlayerSendTextMessage(cid, 27, "Parabéns! você comprou "..buy.item[2].." ".. getItemNameById(buy.item[1]) ..".")
return true
end
local t = {
["nightmare doll"] = {item ={117,1},points = 90},
["sd"] = {item ={2268,100},points = 10}
}
["nome do item"] =
item = {ID DO ITEM, QUANTIDADE}
points = QUANTOS PONTO IRÁ CUSTAR



info
Grupo: Campones
Registrado: 28/07/12
Posts: 27
Reputação: 0
To com o script do Vodkart, http://www.xtibia.co...-system-points/ e queria um shop tipo !pointshop que venda tal item por X creditos..
Tenho um script que acho q vai ajudar quem manja:
local tab = {
["asgard key"] = {id = 134, count = 1, points = 1000},
["nightmare doll"] = {id = 117, count = 1, points = 5000},
["addon doll"] = {id = 116, count = 1, points = 3000},
["sd"] = {id = 2268, count = 100, points = 100},
["mp"] = {id = 7620, count = 100, points = 10},
["hp"] = {id = 7618, count = 100, points = 10},
["gsp"] = {id = 8472, count = 100, points = 110},
["uhp"] = {id = 8473, count = 100, points = 130},
["smp"] = {id = 7589, count = 100, points = 30},
["shp"] = {id = 7588, count = 100, points = 30},
["gmp"] = {id = 7590, count = 100, points = 60},
["ghp"] = {id = 7591, count = 100, points = 60},
["suprem vocation"] = {id = 142, count = 1, points = 30000},
["medal of honour"] = {id = 5785, count = 1, points = 5000},
["lunar staff"] = {id = 7424, count = 1, points = 10000},
["golden bow"] = {id = 7438, count = 1, points = 10000},
}
-- ["nome do item"] = {id = id do item, count = quantidade que vai comprar, points = preço.}
local config = {
pz = true,
battle = true,
premium = false
}
function onSay(cid, words, param)
if not param or param == "" then
return doPlayerSendTextMessage(cid, 27, "Voce possui "..getPoints(cid).." creditos.")
end
if param == 'lista' then
local str = ""
for name,points in pairs(tab) do
str = ("Item: " ..name.. ",\n Preço: " ..points.points.. "")
end
str = str .. ""
doPlayerPopupFYI(cid, str)
return TRUE
end
if config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then
doPlayerSendTextMessage(cid, 21,"Voce so pode comprar um item em protect zone.")
return TRUE
end
if config.premium == true and not isPremium(cid) then
doPlayerSendTextMessage(cid, 21, "Voce so pode comprar um item se for premium.")
return TRUE
end
if config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
doPlayerSendTextMessage(cid, 21, "Voce so pode comprar um item sem battle.")
return TRUE
end
local tab = tab[param]
if tab then
if getPoints(cid) >= tab.points then
doItemSetAttribute(doPlayerAddItem(cid, tab.id, tab.count),"description","Esse item foi comprado por "..getPlayerName(cid)..".")
doPlayerSendTextMessage(cid, 27, "Voce comprou "..tab.count.." "..getItemNameById(tab.id).." por "..tab.points.." creditos, agora voce tem "..getPoints(cid).." creditos.")
doPlayerSendTextMessage(cid, 27, "Voce sera kickado.")
addEvent(addPoints, 100, cid, -tab.points)
end
end
return true
end
function getPoints(cid)
return tonumber(db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. ";"):getDataString("premium_points"))
end
function addPoints(cid, points)
local acc = getPlayerAccountId(cid)
local pp = getPoints(cid)
if isCreature(cid) then
doRemoveCreature(cid)
end
db.executeQuery("UPDATE `accounts` SET `premium_points` = ".. pp + points .." WHERE `id` = " .. acc .. ";")
end