【发布时间】:2020-04-30 11:33:34
【问题描述】:
我正在制作一个 D&D 项目,这是统计部分。我想调用 stats1 函数进行重新滚动。谁能帮我?
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
如果可以的话,我会很高兴收到您的反馈。谢谢!
【问题讨论】:
-
reroll = io.read()