Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- quest lanciadadi begin
- state start begin
- function DoDices(dices)
- local _urDice
- local _cpuDice
- for i = 0, dices do
- _urDice = number(1,6)
- _cpuDice = number(1,6)
- if _urDice ~= _cpuDice then return false end -- if
- end -- for
- return true
- end -- function
- when NPC_VNUM.chat."Voglio lanciare i dadi" begin
- say("Quanti dadi vuoi lanciare? (Min 1, Max 5)")
- local Dices = input()
- Dices = tonumber(Dices)
- if Dices and Dices > 0 and Dices < 6 then
- if DoDices(Dices) then
- say("Hai vinto!")
- -- Dare premio
- else
- say("Hai perso!")
- end -- if
- else
- say("Inserisci un numero tra 1 e 5")
- end -- if
- end -- when
- end -- state
- end -- quest
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement