I'm making a D&D project, and this is the stats portion. I want to call the stats1 function for rerolling. Can anyone help me?
function stats1()
Strength = math.random(1,20)
Dexterity = math.random(1,20)
Constitution = math.random(1,20)
Intelligence = math.random(1,20)
Wisdom = math.random(1,20)
Charisma = math.random(1,20)
print(" Stats ")
print("--------------------------")
print("| Strength | "..Strength.." |")
print("--------------------------")
print("| Dexterity | "..Dexterity.." |")
print("--------------------------")
print("|Constitution| "..Constitution.." |")
print("--------------------------")
print("|Intelligence| "..Intelligence.." |")
print("--------------------------")
print("| Wisdom | "..Wisdom.." |")
print("--------------------------")
print("| Charisma | "..Charisma.." |")
print("--------------------------")
print("Reroll stats?")
reroll = io.read
if reroll == "y" or "Y" then
for Re_Roll = true
stats()
if reroll == "n" or "N" then
Re_Roll = false
end
end
else
print("thanks for being cultured")
end
I'd enjoy the feedback if you can. Thanks!
reroll = io.read()