Ir para conteúdo

Featured Replies

Postado

Então esse deve funcionar:
 

function onUse(cid, item, frompos, item2, topos)
 
local waittime = 5*60     --tempo para usar novamente em segundos. 
local storage = 918318
time = os.time() + waittime

 
if getPlayerStorageValue(cid) storage == 1 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde 5 minutos para usar novamente.")
return false
end
 
if item.itemid == 5785 and doPlayerRemoveMoney(cid,500000) == 1 and getPlayerLevel (cid) >= 500 then
doSendMagicEffect(topos,14) 
doPlayerSay(cid,"Level Odblokowany",16) 
addLevel(cid,1)
doSendMagicEffect(topos,14) 
doPlayerSay(cid,"Level Odblokowany",16) 
setPlayerStorageValue(cid, storage, time)
else
doPlayerSay(cid,"Sorry Niemasz 50 Gold",16) 
doPlayerSendCancel(cid,"Sorry no have Lvl 500!")
end
return 1
end
  • Respostas 15
  • Visualizações 679
  • Created
  • Última resposta

Top Posters In This Topic

Postado

só algumas correções: 

function onUse(cid, item, frompos, item2, topos)
 
local waittime = 5*60     --tempo para usar novamente em segundos. 
local storage = 918318
time = os.time() + waittime

 
if getPlayerStorageValue(cid, storage) - os.time > 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde 5 minutos para usar novamente.")
return false
end
 
if item.itemid == 5785 and doPlayerRemoveMoney(cid,500000) and getPlayerLevel (cid) >= 500 then
doSendMagicEffect(topos,14) 
doPlayerSay(cid,"Level Odblokowany",16) 
addLevel(cid,1)
doSendMagicEffect(topos,14) 
doPlayerSay(cid,"Level Odblokowany",16) 
setPlayerStorageValue(cid, storage, time)
else
doPlayerSay(cid,"Sorry Niemasz 50 Gold",16) 
doPlayerSendCancel(cid,"Sorry no have Lvl 500!")
end
return true
end

Depois que vc seta o storage como sendo o tempo de agora + uma quantidade de tempo ele não vai voltar nunca a ser 1.

Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá!

"Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

Postado
  • Autor

só algumas correções: 

function onUse(cid, item, frompos, item2, topos)
 
local waittime = 5*60     --tempo para usar novamente em segundos. 
local storage = 918318
time = os.time() + waittime

 
if getPlayerStorageValue(cid, storage) - os.time > 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde 5 minutos para usar novamente.")
return false
end
 
if item.itemid == 5785 and doPlayerRemoveMoney(cid,500000) and getPlayerLevel (cid) >= 500 then
doSendMagicEffect(topos,14) 
doPlayerSay(cid,"Level Odblokowany",16) 
addLevel(cid,1)
doSendMagicEffect(topos,14) 
doPlayerSay(cid,"Level Odblokowany",16) 
setPlayerStorageValue(cid, storage, time)
else
doPlayerSay(cid,"Sorry Niemasz 50 Gold",16) 
doPlayerSendCancel(cid,"Sorry no have Lvl 500!")
end
return true
end

Depois que vc seta o storage como sendo o tempo de agora + uma quantidade de tempo ele não vai voltar nunca a ser 1.

deu um novo erro:

Lua Script Error: [Action Interface]
data/actions/scripts/desbugaxp.lua:onUse

data/actions/scripts/desbugaxp.lua:8: attempt to perform arithmetic on field 'time' <a fuction value>

I helped you ? REP +.

 

Att: Abreu

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo