Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------------
- --- (c)Muzze77 Gewinnspiel 1.0 ---
- ----------------------------------
- --±++++++++ variables ++++++++++--
- maxzahl = 3 -- Maximale Gewinnchane in Zahlen ( math.random(3) zb ist 1,2,3 math.random(5) 1,2,3,4,5)
- minzahl = 1 -- Bleibt einfach Stehen !
- ID = math.random(minzahl, maxzahl)
- Item1 = "Rubin" -- ItemName für Item 1
- Item2 = "Saphir" -- ItemName für Item 2
- Item3 = "Smaragt" -- ItemName für Item 3
- -- Mit maxItems kann die MaximalMenge auch erhöht werden (
- --±+++++++++++++++++++++++++++++--
- ----------------------------------
- --±++++++++ functions ++++++++++--
- local function randomGame()
- ID2 = tonumber(io.read()) -- Liest Deine Eingabe
- print(ID .. " = " .. ID2) -- Print ob ID Gleich ist mit ID2
- if ID == ID2 then -- Wenn es das ist
- if ID == 1 then -- ItemName for Item 1 -- Wenn ID gleich 1 war
- rs.setBundledOutput("top", colors.red)
- print("Gewonnen ! , Item : ".. Item1)
- sleep(4)
- rs.setBundledOutput("top", 0)
- sleep(20)
- shell.run("redpulse left 1 1")
- elseif ID == 2 then -- Wenn ID gleich 2 war
- print("Gewonnen ! , Item : ".. Item2)
- rs.setBundledOutput("top", colors.blue)
- sleep(4)
- rs.setBundledOutput("top", 0)
- sleep(20)
- shell.run("redpulse left 1 1")
- elseif ID == 3 then -- Wenn ID gleich 3 war
- print("Gewonnen ! , Item : ".. Item3)
- rs.setBundledOutput("top", colors.green)
- sleep(4)
- rs.setBundledOutput("top", 0)
- sleep(20)
- shell.run("redpulse left 1 1")
- end
- else
- print("Du hast Verloren!")
- end
- end
- --±+++++++++++++++++++++++++++++--
- ----------------------------------
- --±++++++++ programms ++++++++++--
- print("----------------------------------\n--- (c)Muzze77 Gewinnspiel 1.0 ---\n----------------------------------")
- print("Gebe eine Zahl zwischen " .. minzahl .. " & " .. maxzahl .. " ein: ")
- randomGame()
- --±+++++++++++++++++++++++++++++--
- ----------------------------------
- --±+++++ end / comentary +++++++--
- --±+++++++++++++++++++++++++++++--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement