Tenta assim:
Vai em data/talkaction e crie um arquivo qualquer, com o nome que quiser e cole isto dentro:
function onSay(cid, words, param, channel)
local split = param:explode(",")
local name, count = split[1], tonumber(split[2])
pid = getPlayerByNameWildcard(name)
if (not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " is not currently online.")
return TRUE
end
if not(split[2]) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The commands requires 2 parameters: character name, amount")
end
if not(count) then
print(count)
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Numeric parameter required.")
end
setPlayerStorageValue(pid, 2343, count)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" .. count .. " points were added to " .. getCreatureName(pid) .. "\'s Account.")
return true
end
Em talkactions.xml cole esta tag:
<talkaction words="/addpoints" access="5" event="script" value="nome do arquivo.lua"/>
Com o GOD você fala "/addpoints nome do player, número de points".
Agora ainda em talkactions crie o segundo arquivo,e cole este script:
function onSay(cid, words, param, channel)
doPlayerSendTextMessage(cid, 27, "Você tem: "..getPlayerStorageValue(cid, 2343).." Points em sua conta.")
return true
end
Em talkactions.xml cole esta tag:
<talkaction words="/mypoints" event="script" value="nome do arquivo.lua"/>
Fale com um player "/mypoints" e confira quantos points você tem.
Agora em data/actions/scripts faça o mesmo procedimento:
local config = {
pointsNessecerys = 5, -- Pontos necessários para realizar a quest
reward = 2160, -- Item que vai ganhar
count = 4, -- Quantidade de itens que vai ganhar
}
function onUse(cid, item)
if getPlayerStorageValue(cid, 4756) < 1 then
if getPlayerStorageValue(cid, 2343) >= config.pointsNessecerys then
setPlayerStorageValue(cid, 2343, getPlayerStorageValue(cid, 2343) - config.pointsNessecerys)
doPlayerAddItem(cid, config.reward, config.count)
doSendMagicEffect(getThingPos(cid), math.random(28, 30))
setPlayerStorageValue(cid, 4756, 1)
else
doPlayerSendTextMessage(cid, 27, "Sorry, you need a "..config.pointsNessecerys.." for complet the quest.")
return true
end
else
doPlayerSendTextMessage(cid, 27, "Sorry, the chest is empyt.")
return true
end
end
Em actions.xml cole esta tag::
<action actionid="3745" event="script" value="nome do arquivo.lua"/>
Coloque uma actionid no baú, use o rme editor, com o número: 3745