UR
pedido

Bless Não Funciona Me Ajudem Urgente

Por UroTTa, 22 de out. de 2012 em Scripts

resolvido
17
2.3k
UroTTaU
22 de outubro de 2012 às 19:38

Bom, quando algum player compra bless no meu server, algumas vezes ela não funciona, perde items é muitos level e as vezes não da para comprar a bless novamente, buga tudo. Alguem me ajude por favor, abaixo postarei meu comando:

 

function onSay(cid, words, param)

if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then

doPlayerSendCancel(cid,'You have already got one or more blessings!')

else

if doPlayerRemoveMoney(cid, 50000) == TRUE then

doPlayerAddBlessing(cid, 1)

doPlayerAddBlessing(cid, 2)

doPlayerAddBlessing(cid, 3)

doPlayerAddBlessing(cid, 4)

doPlayerAddBlessing(cid, 5)

doSendMagicEffect(getPlayerPosition(cid), 28)

doPlayerAddItem(cid, 2173, 1)

doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'Você ganhou um AOL, caso a bless falhe use por prevenção!')

doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'You have been blessed by the gods!')

else

doPlayerSendCancel(cid, "You need 5 crystal coin to get blessed!")

end

end

return TRUE

end

 

 

 

REP+ para quem me ajudar.

Session StartS
22 de outubro de 2012 às 21:32

Tenta assim...

 

 

 

 

function onSay(cid, words, param)

if getPlayerBlessing(cid, 1) and getPlayerBlessing(cid, 2) and getPlayerBlessing(cid, 3) and getPlayerBlessing(cid, 4) and getPlayerBlessing(cid, 5) then

doPlayerSendCancel(cid,'You have already got one or more blessings!')

else

if doPlayerRemoveMoney(cid, 50000) == TRUE then

doPlayerAddBlessing(cid, 1)

doPlayerAddBlessing(cid, 2)

doPlayerAddBlessing(cid, 3)

doPlayerAddBlessing(cid, 4)

doPlayerAddBlessing(cid, 5)

doSendMagicEffect(getPlayerPosition(cid), 28)

doPlayerAddItem(cid, 2173, 1)

doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'Você ganhou um AOL, caso a bless falhe use por prevenção!')

doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'You have been blessed by the gods!')

else

doPlayerSendCancel(cid, "You need 5 crystal coin to get blessed!")

end

end

return TRUE

end

 

 

 

testa ai..

SkyLighS
22 de outubro de 2012 às 22:06

@CLEBERADM você posto o mesmo script do tópico !

 

tente assim .

 

local bless = {1, 2, 3, 4, 5}
local cost = 80000
function onSay(cid, words, param)
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doPlayerSendCancel(cid, "Voceja tem todas as bless.")
return TRUE
end
end
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
end
doCreatureSay(cid, "You are now blessed!" ,19)
doSendMagicEffect(getPlayerPosition(cid), 49)
else
doPlayerSendCancel(cid, "Voce precisa de 80k para a bless.")
end
return TRUE
end

Editado Outubro 22 por SkyLigh

Session StartS
22 de outubro de 2012 às 22:34

É o mesmo nao, olhe bem 'fedepe' '-'

UroTTaU
26 de outubro de 2012 às 18:26

Não funcionou nenhum dos dois ;/

Session StartS
26 de outubro de 2012 às 19:55

Mas o que acontece agora? aparece algum erro no console?

FoquinhaaF
26 de outubro de 2012 às 20:02

Npc que vende Bless - http://www.xtibia.com/forum/topic/140159-npc-blessing-seller/

 

Vá em data/talkactions/scripts e copie um arquivo qualquer renomeie e apague oque estiver dentro, e coloque isso.

 

function onSay(cid, words, param)
local bless = {1, 2, 3, 4, 5}
local preço = 1000 --O Preço da bless

if(doPlayerRemoveMoney(cid, preço) == TRUE) then
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doSendMagicEffect(getCreaturePosition(cid),13)
doCreatureSay(cid, "!! COMPREI BLESS !! SABIA ??", TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, "Sera Que So Pobre Mesmo ?? Me Arruma Um $$ Ai Que Eu Agradeço", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end

 

Créditos : SmartBox , por fazer o script eu apenas achei e coloquei aqui.

Yan OliveiraY
26 de outubro de 2012 às 20:11

@UroTTa

 

Tente assim:

 

local bless = {1, 2, 3, 4, 5}

local cost = 80000
function onSay(cid, words, param)
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doPlayerSendCancel(cid, "Voceja tem todas as bless.")
return true
end
end
if(doPlayerRemoveMoney(cid, cost) == true) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
end
doCreatureSay(cid, "You are now blessed!" ,19)
doSendMagicEffect(getPlayerPosition(cid), 49)
else
doPlayerSendCancel(cid, "Voce precisa de 80k para a bless.")
end
return true
end

SkyLighS
26 de outubro de 2012 às 20:13

ta todo bugado esse script do bless o talk

 

arrumei os erros dele .

 

 function onSay(cid, words, param)
local bless = {1, 2, 3, 4, 5}
local price = 1000 --O Preço da bless
if(doPlayerRemoveMoney(cid, price) == TRUE) then
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doSendMagicEffect(getCreaturePosition(cid),13)
doCreatureSay(cid, "!! COMPREI BLESS !! SABIA ??", TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, "Sera Que So Pobre Mesmo ?? Me Arruma Um $$ Ai Que Eu Agradeço", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
end
end

Yan OliveiraY
26 de outubro de 2012 às 20:19

ta todo bugado esse script do bless o talk

 

arrumei os erros dele .

 

 function onSay(cid, words, param)
local bless = {1, 2, 3, 4, 5}
local price = 1000 --O Preço da bless
if(doPlayerRemoveMoney(cid, price) == TRUE) then
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doSendMagicEffect(getCreaturePosition(cid),13)
doCreatureSay(cid, "!! COMPREI BLESS !! SABIA ??", TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, "Sera Que So Pobre Mesmo ?? Me Arruma Um $$ Ai Que Eu Agradeço", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
end
end

 

Skyligh você postou o mesmo script q o TecBreakerByLipe postou vc so add algumas funções.

SkyLighS
26 de outubro de 2012 às 20:33

@yan18

 

testei o script dele pelo debug.lua esta todo bugado faltava 2 end's envez de price tava preço que no .lua n pode ser usado "ç"

 

preste atenção

UroTTaU
26 de outubro de 2012 às 20:41

@Cleberadm

 

O seu funcionou perfeitamente, mas quando o player reloga a bless sai.

 

@Yan18

 

Esse script ta dando debug igual aos outros, e a bless não funciona.

SkyLighS
26 de outubro de 2012 às 21:05

tente assim .

 

function onSay(cid, words, param, channel)
if getPlayerBlessing(cid, 1) and getPlayerBlessing(cid, 2) and getPlayerBlessing(cid, 3) and getPlayerBlessing(cid, 4) and getPlayerBlessing(cid, 5) then
doPlayerSendCancel(cid,'You have already got one or more blessings!')
else
if doPlayerRemoveMoney(cid, 50000) == TRUE then
for i = 1, table.maxn(bless) do
if doPlayerAddBlessing(cid, 1) and doPlayerAddBlessing(cid, 2) and doPlayerAddBlessing(cid, 3) and doPlayerAddBlessing(cid, 4) and doPlayerAddBlessing(cid, 5) then
doPlayerAddBlessing(cid, 5)
doSendMagicEffect(getPlayerPosition(cid), 28)
doPlayerAddItem(cid, 2173, 1)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'Você ganhou um AOL, caso a bless falhe use por prevenção!')
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'You have been blessed by the gods!')
else
doPlayerSendCancel(cid, "You need 5 crystal coin to get blessed!")
end
end
return TRUE
end
end
end

UroTTaU
26 de outubro de 2012 às 21:57

Não funcionou kk

FoquinhaaF
26 de outubro de 2012 às 22:19

Tente este.

 

-- !blessing
local cost = 50000 -- Cost in gp.

function onSay(cid, words, param)




if getPlayerBlessing(cid, 5) == TRUE then
doPlayerSendCancel(cid, "You have already have been blessed.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end

if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSendAnimatedText(getCreaturePosition(cid), 'Blessed!!!', TEXTCOLOR_DARKORANGE)
return TRUE
else
doPlayerPopupFYI(cid, "You need to have "..cost.."gp to buy blessings.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end



end