antiblock
Cyphriun
  • Chatbox

    You don't have permission to chat.
    Load More
Phokencio

Lotaria

9 posts in this topic

Boas acabei de criar/modificar uma quest de lotaria que é a seguinte:

 

 

quest lotaria begin

    state start begin
   when 20041.chat."Lotaria" begin
   if 30 > get_global_time() - pc . getqf ( "lottery_last_play" ) then
   say ("Deves esperar 30 segundos antes de repetir o jogo")
   return
    end
    say_title ( "Aposta" )
    say ("Deves esperar 30 segundos antes de jogar novamente.")
    say_reward ("Preciso de: 50.000 Yang")
    say ("Queres continuar?")
    local scelta = select ( "Sim","Nao" )
    if scelta == 1 then
   if pc . gold >= 50000 then
   pc . changegold ( - 50000 )
   local k
   repeat
   say_title ( "Aposta" )
   say ( "Introduz um numero de 1 a 20" )
   say ("Se corresponder ao numero")
   say ("eligido podes ganhar o")
   say ("maior premio de 50.000.000 Yang!!")
   k = tonumber(input())
   if k == nil then
   say_title("Aposta")
   say("Insere o numero!")
   local s = select("Continuar", "Anular")
   if s == 2 then
   return
   end
   else
   if k <= 0 then
   say_title("Aposta")
   say("Deves introduzir um numero positivo!")
   local s = select("Continuar", "Anular")
   if s == 2 then
   return
   end
   else
   if k > 20 then
   say_title("Aposta")
   say("Deves introduzir um numero entre 1 e 20")
   local s = select("Continuar", "Anular")
   if s == 2 then
   return
   end
   else
   break
   end
   end
   end
   until false
   say("Numero elegido: " .. k )
   wait ()
   say ("Agora procedemos o numero")
   local random_number = tostring(number(1,20))
   say("Numero elaborado: " .. random_number)
   if random_number == tostring(k) then
   say ("Que sortudo, acabas-te de ganhar 50kk!")
   say_reward ("Recebes-te 50.000.000 Yang")
   pc.changegold ( 50000000 )
   else
   say ("Sinto muito mas nem sempre se ganha!")
   end
   end
   pc.setqf("lottery_last_play" , get_global_time())
   return
    end
    end
    end
    end

 

O que acham? Sou noob nestas coisas xD

Share this post


Link to post
Share on other sites
antiblock
Elveron

tu não criaste/modificaste !Só mudaste falas , e o npc .

Share this post


Link to post
Share on other sites

neps coloquei no meu server e estava bugada, tive a ver qual era o erro que ela tinha

Share this post


Link to post
Share on other sites

Bem, não quero saber se foste tu que as fizeste ou se as editas-te, só sei que me vão dar geito!

 

Obrigado por teres postado, tens o meu + 1.

 

Cumprimentos.

Share this post


Link to post
Share on other sites
quest lotaria begin    state start begin   when 20041.chat."Lotaria" begin   if 30 > get_global_time() - pc . getqf ( "lottery_last_play" ) then   say ("Deves esperar 30 segundos antes de repetir o jogo")   return    end    say_title ( "Aposta" )    say ("Deves esperar 30 segundos antes de jogar novamente.")    say_reward ("Preciso de: 50.000 Yang")    say ("Queres continuar?")    local scelta = select ( "Sim","Nao" )    if scelta == 1 then   if pc . gold >= 50000 then   pc . changegold ( - 50000 )   local k   repeat   say_title ( "Aposta" )   say ( "Introduz um numero de 1 a 20" )   say ("Se corresponder ao numero")   say ("eligido podes ganhar o")   say ("maior premio de 50.000.000 Yang!!")   k = tonumber(input())   if k == nil then   say_title("Aposta")   say("Insere o numero!")   local s = select("Continuar", "Anular")   if s == 2 then   return   end   else   if k <= 0 then   say_title("Aposta")   say("Deves introduzir um numero positivo!")   local s = select("Continuar", "Anular")   if s == 2 then   return   end   else   if k > 20 then   say_title("Aposta")   say("Deves introduzir um numero entre 1 e 20")   local s = select("Continuar", "Anular")   if s == 2 then   return   end   else   break   end   end   end   until false   say("Numero elegido: " .. k )   wait ()   say ("Agora procedemos o numero")   local random_number = tostring(number(1,20))   say("Numero elaborado: " .. random_number)   if random_number == tostring(k) then   say ("Que sortudo, acabas-te de ganhar 50kk!")   say_reward ("Recebes-te 50.000.000 Yang")   pc.changegold ( 50000000 )   else   say ("Sinto muito mas nem sempre se ganha!")   end   end   pc.setqf("lottery_last_play" , get_global_time())   return    end    end    end    end

Share this post


Link to post
Share on other sites

Seria legal se anunciasse no chat quando alguém ganhasse!^^

Share this post


Link to post
Share on other sites
9 horas atrás, DeathOfKill disse:

Seria legal se anunciasse no chat quando alguém ganhasse!^^

Não percebi se queres que informe toda a gente ou só informe a pessoa em si

Mas mesmo assim vou te ensinar duas funções ;)

 

Só para a pessoa:

 

Função: notice

 

Exemplo de quest:

quest X begin
    state start begin
        when login begin
            notice("Conseguiste entrar! uau")
        end
    end
end

 

d13e3624850b23709d8a063582e6080e.png

 

Para toda a gente:

 

Função: notice_all

 

Exemplo de quest:

quest X begin
    state start begin
        when login begin
            notice_all("O jogador "..pc.get_name().." entrou!")
        end
    end
end

af7f3f9cc695577b3a174c5aa982748d.png

Share this post


Link to post
Share on other sites
Em 22/12/2014 at 12:58, βŁά©Ќ§†ŏ®ε™ disse:

quest lotaria begin    state start begin   when 20041.chat."Lotaria" begin   if 30 > get_global_time() - pc . getqf ( "lottery_last_play" ) then   say ("Deves esperar 30 segundos antes de repetir o jogo")   return    end    say_title ( "Aposta" )    say ("Deves esperar 30 segundos antes de jogar novamente.")    say_reward ("Preciso de: 50.000 Yang")    say ("Queres continuar?")    local scelta = select ( "Sim","Nao" )    if scelta == 1 then   if pc . gold >= 50000 then   pc . changegold ( - 50000 )   local k   repeat   say_title ( "Aposta" )   say ( "Introduz um numero de 1 a 20" )   say ("Se corresponder ao numero")   say ("eligido podes ganhar o")   say ("maior premio de 50.000.000 Yang!!")   k = tonumber(input())   if k == nil then   say_title("Aposta")   say("Insere o numero!")   local s = select("Continuar", "Anular")   if s == 2 then   return   end   else   if k <= 0 then   say_title("Aposta")   say("Deves introduzir um numero positivo!")   local s = select("Continuar", "Anular")   if s == 2 then   return   end   else   if k > 20 then   say_title("Aposta")   say("Deves introduzir um numero entre 1 e 20")   local s = select("Continuar", "Anular")   if s == 2 then   return   end   else   break   end   end   end   until false   say("Numero elegido: " .. k )   wait ()   say ("Agora procedemos o numero")   local random_number = tostring(number(1,20))   say("Numero elaborado: " .. random_number)   if random_number == tostring(k) then   say ("Que sortudo, acabas-te de ganhar 50kk!")   say_reward ("Recebes-te 50.000.000 Yang")   pc.changegold ( 50000000 )   else   say ("Sinto muito mas nem sempre se ganha!")   end   end   pc.setqf("lottery_last_play" , get_global_time())   return    end    end    end    end

É possivel  q ao inves de gold pra fazer a aposta precise de um item especifico ???

desde já agradeço !!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now