Esse da item p/ todos online "talvez ti ajude " :
Vlw
info
Group: Herói
Joined: 25/10/12
Posts: 2.4k
Reputation: +687
Gender: Masculino
Tibia Character: Nuncative

Esse da item p/ todos online "talvez ti ajude " :
Vlw
info
Group: Infante
Joined: 27/01/13
Posts: 1.7k
Reputation: +104
Gender: Masculino

Nao quero dar para todos,e sim para um em especifico
info
Group: Herói
Joined: 14/12/10
Posts: 3.6k
Reputation: +846
Gender: Masculino

Obrigado por me usar no exemplo acima ![]()
Vamos fazer assim, em data/talkactions/scripts, crie um arquivo chamado additem.lua e coloque isso dentro:
--[[ ADDITEM by Won Helder ]]--
--[[ Créditos: 20% Vodkart e DevilMoon pela lógica ]]--
--[[ XTIBIA.COM ]]--
function onSay(cid, words, param)
local t = string.explode(param, ",")
if not t[3] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
return true
end
local player = getPlayerByName(t[1])
local quanty = t[3]
local pid = getPlayerByNameWildcard(t[1])
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")
return true
end
local id = tonumber(t[2])
if(not id) then
id = getItemIdByName(t[2], false)
if(not id) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.")
return true
end
end
local itemtoadd = getItemIdByName(t[2])
if getItemWeightById(itemtoadd) > getPlayerFreeCap(player) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O jogador " .. t[1] .. " não tem capacidade o suficiente.")
return true
end
doPlayerAddItem(player, itemtoadd, t[3])
doPlayerSendTextMessage(player, 22, "Você ganhou " ..quanty.. " " .. t[2] .. " ")
doPlayerSendTextMessage(cid, 22, "Você deu " ..quanty.. " " .. t[2] .. " ao jogador " .. t[1] .. " ")
return true
end
Em talkactions.xml adicione essa linha:
<talkaction log="yes" words="/additem" access="4" event="script" value="additem.lua"/>
Apenas GM ou cargo maior podem utilizar, o comando é:
/additem Nome do Jogador, Nome do Item, Quantidade
Boa sorte.
info
Group: Infante
Joined: 27/01/13
Posts: 1.7k
Reputation: +104
Gender: Masculino

Vlw REP+,o comando eu posso muda neh?tipo /additem para /ts?
info
Group: Herói
Joined: 14/12/10
Posts: 3.6k
Reputation: +846
Gender: Masculino

Sim sim, aqui:
<talkaction log="yes" words="/additem" access="4" event="script" value="additem.lua"/>
Entre as aspas, aonde está pode mudar o /additem, para faciitar, aqui está:
<talkaction log="yes" words="/ts" access="4" event="script" value="additem.lua"/>
Tópico movido para pedidos e dúvidas resolvidos.
info
Group: Infante
Joined: 27/01/13
Posts: 1.7k
Reputation: +104
Gender: Masculino
Tipo do script:Talkactions
Protocolo (versão do Tibia):8.54
Servidor utilizado:Naruto OT-Server
Nível de experiência:20
Adicionais/Informações:Quando o god falar exemplo,/ts nome do player,item,quantidade,ai automaticamente o x item vai para o player estando off ou on
/ts poksas,2160,100