Ich habe für meinen Server versucht ein Lotto system zu machen aller dings bin ich nicht der Profi in Lua deswegen wollte ich euch mal fragen ob der Code gehen würde
das ist mein Code:
Lua
-- Lotto Zahlen Zufällig
Zahl1 = 0
Zahl2 = 0
Zahl3 = 0
Zahl4 = 0
Zahl5 = 0
Zahl6 = 0
Zahls = 0 -- Superzahl
-- User lotto Zahlen
Lotto1 = 0
Lotto2 = 0
Lotto3 = 0
Lotto4 = 0
Lotto5 = 0
Lotto6 = 0
Lottos = 0 -- Superzahl
-- Punkte
Punkte = 0
while Punkte > 100 do
-- gewinnauschüttung !!!
end
if Zahl1 = 0 then
math.random(0,49)
Zahl1 = (math.random)
end
if Zahl2 = 0 then
math.random(0,49)
Zahl2 = (math.random)
end
if Zahl3 = 0 then
math.random(0,49)
Zahl3 = (math.random)
end
if Zahl4 = 0 then
math.random(0,49)
Zahl4 = (math.random)
end
if Zahl5 = 0 then
math.random(0,49)
Zahl5 = (math.random)
end
if Zahl6 = 0 then
math.random(0,49)
Zahl6 = (math.random)
end
if Zahls = 0 then
math.random(0,49)
Zahls = (math.random)
end
function Lotto() --
shell.run("clear") -- das ist von Minecraft um die Seite zu Clearen
print("Bitte geben sie ihre erste Lottozahl ein.")
write("--> ")
Lotto1 = io.read()
sleep(1)
shell.run("clear") -- das ist von Minecraft um die Seite zu Clearen
print("Bitte geben sie ihre zweite Lottozahl ein.")
write("--> ")
Lotto2 = io.read()
sleep(1)
shell.run("clear") -- das ist von Minecraft um die Seite zu Clearen
print("Bitte geben sie ihre dritte Lottozahl ein.")
write("--> ")
Lotto3 = io.read()
sleep(1)
shell.run("clear") -- das ist von Minecraft um die Seite zu Clearen
print("Bitte geben sie ihre vierte Lottozahl ein.")
write("--> ")
Lotto4 = io.read()
sleep(1)
shell.run("clear") -- das ist von Minecraft um die Seite zu Clearen
print("Bitte geben sie ihre fuenfte Lottozahl ein.")
write("--> ")
Lotto5 = io.read()
sleep(1)
shell.run("clear") -- das ist von Minecraft um die Seite zu Clearen
print("Bitte geben sie ihre sechste Lottozahl ein.")
write("--> ")
Lotto6 = io.read()
sleep(1)
shell.run("clear") -- das ist von Minecraft um die Seite zu Clearen
print("Bitte geben sie ihre Superzahl Lottozahl ein.")
write("--> ")
Lottos = io.read()
sleep(1)
end
function punktevergabe()
if Zahl1 == Lotto1 then
Punkte + 15
print(Punkte)
sleep(2)
if Zahl2 == Lotto2 then
Punkte + 15
print(Punkte)
sleep(2)
if Zah3 == Lotto3 then
Punkte + 15
print(Punkte)
sleep(2)
if Zahl4 == Lotto4 then
Punkte + 15
print(Punkte)
sleep(2)
if Zahl5 == Lotto5 then
Punkte + 15
print(Punkte)
sleep(2)
if Zahl6 == Lotto6 then
Punkte + 15
print(Punkte)
sleep(2)
if Zahls == Lottos then
Punkte + 15
print(Punkte)
sleep(2)
else
print("Die zahl war leider Falsch du bekommst hier fuer keine Punkte.")
sleep(3)
end
Alles anzeigen