Qual funçao devo usar

popohat7
em Scripts

popohat7

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 20/01/08Posts: 56Char no Tibia: SKyDevILFiRe

Gente, quero colocar para apenas quem tiver um determinado item na backpack pode usar a talkaction .

 

Qual função devo colocar ?

 

Obrigado

Me ajudo? Dou rep+

[*]---------[*]----------[*]

Te ajudei ? De rep+

 

uladop1807b.png

 

75718.png

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

if getPlayerItemCount(cid, 1111) >= 1 then

 

seria isso?

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

popohat7

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 20/01/08Posts: 56Char no Tibia: SKyDevILFiRe

 

-- Script by LuckOake

function onSay(cid, words, param)

local waittime = 10 -- Tempo de exhaustion

local storage = 6853

ppos = getCreaturePosition(cid)

parea1 = {x=ppos.x-7, y=ppos.y-5, z=ppos.z}

parea2 = {x=ppos.x+7, y=ppos.y+5, z=ppos.z}

level = 1 -- Level que o player necessita para usar a talk

item = 6578

if getPlayerLevel(cid) < level then

doPlayerSendCancel(cid, "Você precisa de level "..level.." para usar essa magia.") return true

elseif isVip(cid) == FALSE then

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "você precisa ser vip.") return true

end

if getPlayerItemCount(cid, item) >= 1 then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você precisa do item xxxx na sua backpack para usar essa magia.")

return true

end

if exhaustion.check(cid, storage) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.")

return true

end

for _, pid in ipairs(getPlayersOnline()) do

if isInArea(getCreaturePosition(pid), parea1, parea2) then

if getPlayerAccess(pid) <= 2 then

doCreatureSetNoMove(pid, true)

doSendMagicEffect(getCreaturePosition(pid), 30)

setPlayerStorageValue(pid, 1634, 1)

addEvent(setPlayerStorageValue, 1000, pid, 1634, -1)

doCreatureSay(pid, "*time stopped*", TALKTYPE_MONSTER)

addEvent(doCreatureSay, 1000, pid, "*time is back to normal*", TALKTYPE_MONSTER)

addEvent(doCreatureSetNoMove, 1000, pid, false)

else

end

end

end

doCreatureSetNoMove(cid, false)

exhaustion.set(cid, storage, waittime)

doCreatureSay(cid, "stop time", TALKTYPE_MONSTER)

return true

end

 

 

Eu add ele no script mas ta dando efeito ao contrario ele usa sem o item e quando ta com o item nao pode usar a talk

OBS: Sou noob em script devo ter feito errado =)

Me ajudo? Dou rep+

[*]---------[*]----------[*]

Te ajudei ? De rep+

 

uladop1807b.png

 

75718.png

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

troca o >= 1 para <= 0... pensei q ia usar de outra maneira ^^

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

popohat7

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 20/01/08Posts: 56Char no Tibia: SKyDevILFiRe

Funfo certinho brigadao

Me ajudo? Dou rep+

[*]---------[*]----------[*]

Te ajudei ? De rep+

 

uladop1807b.png

 

75718.png

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

sanado, movido

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein