talkaction:
POINTSSTORAGE = 0000 -- STORAGE DOS POINTS
local items = {
["boots of haste"] = {id = 2525, count = 1, points = 20},
["dwarven shield"] = {id = 2525, count = 1, points = 1}
}
-- ["nome do item"] = {id = id do item, count = quantidade que vai comprar, points = preço.}
function onSay(cid, words, param)
if not param or param == "" then
return doPlayerSendTextMessage(cid, 27, "You have "..getPoints(cid).." points.")
end
local tab = items[param]
if tab then
if getPoints(cid) >= tab.points then
doPlayerAddItem(cid, tab.id, tab.count)
addPoints(cid, -tab.points)
doPlayerSendTextMessage(cid, 27, "You buy "..tb.count.." "..getItemNameById(tab.id).." for "..tab.points.." points, will now remain "..getPoints(cid).." points.")
end
end
return true
end
function getPoints(cid)
return getPlayerStorageValue(cid, POINTSSTORAGE)
end
function addPoints(cid, points)
return setPlayerStorageValue(cid, POINTSSTORAGE, getPlayerStorageValue(cid, POINTSSTORAGE) + points)
end
tag:
<talkaction words="!vip" event="script" value="NOME DO ARQUIVO.lua"/>
fui.


info
Grupo: Campones
Registrado: 01/06/11
Posts: 12
Reputação: +14
Char no Tibia: Jacques Leeclair
Tipo do script:TalkAction
Protocolo (versão do Tibia):8.60
Servidor utilizado:TFS
Nível de experiência:Medio
Adicionais/Informações:Queria Uma TalkAction , de comprar items. Porem so se pode comprar esses items, se voce tiver POINTS.
Os points que sao comprados no SITE.
E tambem uma magia pra checkar seus points .
Exemplos :!vip --(VOCE AINDA TEM 20 POINTS)
!vip boots of haste. (VOCE COMPROU UMA BOOTS OF HASTE POR 20 POINTS, AGORA LHE RESTAM 0 POINTS.)
Por favor me ajudem, sera muito importante no meu OTS.
Grato!!!