function onSay(cid, words, param, channel)
if channel == x then
...
end
return true
end
info
Group: Artesão
Joined: 17/01/12
Posts: 137
Reputation: -1
Tibia Character: Nao Tenho

function onSay(cid, words, param, channel) if channel == x then ... end return true end
tem como voce colocar pra mim nesse script
function onSay(cid, words)
item = 2148
quantidade = 1
local storage = 5555555
if getPlayerStorageValue(cid, storage) >= 1 then
return true
else
setPlayerStorageValue(cid, storage, 1)
end
doPlayerAddItem(cid, item, quantidade)
return true
end
local t = {
item = 2148,
quantidade = 1,
storage = 5555555
}
function onSay(cid, words, param, channel)
if channel == CHANNEL_HELP then
if getPlayerStorageValue(cid, t.storage) >= 1 then
doPlayerSendCancel(cid, "Você já pegou seu item.")
else
doPlayerAddItem(cid, t.item, t.quantidade)
setPlayerStorageValue(cid, t.storage, 1)
doPlayerSendTextMessage(cid, 22, "Você ganhou ".. t.quantidade .." ".. getItemNameById(t.item) ..".")
end
else
doPlayerSendTextMessage(cid, 22, "Você só pode usar este comando no Help.")
end
return true
end
Ali está para falar só no HELP, troque pelo que você quer.
Edited Julho 20 by Leoxtibia
info
Group: Artesão
Joined: 17/01/12
Posts: 137
Reputation: -1
Tibia Character: Nao Tenho

local t = { item = 2148, quantidade = 1, storage = 5555555 } function onSay(cid, words, param, channel) if channel == CHANNEL_HELP then if getPlayerStorageValue(cid, t.storage) >= 1 then doPlayerSendCancel(cid, "Você já pegou seu item.") else doPlayerAddItem(cid, t.item, t.quantidade) setPlayerStorageValue(cid, t.storage, 1) doPlayerSendTextMessage(cid, 22, "Você ganhou ".. t.quantidade .." ".. getItemNameById(t.item) ..".") end else doPlayerSendTextMessage(cid, 22, "Você só pode usar este comando no Help.") end return true end
Ali está para falar só no HELP, troque pelo que você quer.
nao deu certo...
e tipo testei no help, ai aparece que voce ganhou o item mas nao deu o item, ele nao aparece na bag
Edited Julho 20 by Diley007
Então você deve ter feito algo errado, testei aqui e funcionou. Deixa eu ver seu script e sua tag.
info
Group: Artesão
Joined: 17/01/12
Posts: 137
Reputation: -1
Tibia Character: Nao Tenho

Então você deve ter feito algo errado, testei aqui e funcionou. Deixa eu ver seu script e sua tag.
deu deu, pode deixar vlw aeee....
aff ou so mais tarde que posso da REP+, mais vai ser sem falta...
Edited Julho 20 by Diley007




info
Group: Artesão
Joined: 17/01/12
Posts: 137
Reputation: -1
Tibia Character: Nao Tenho
quero uma talkaction que so funciona em determinado channel, e possivel ne ?
REP+
Edited Julho 19 by Diley007