Ok, so im tryna do that table chooses 16 variants of number of 8 numbers radius of specific number but NOT the specific number using math.random. Unfortunately math.random can choose the number i dont want twice and idk how to prevent that this is my script, where chosen.answer is the specific number, if you know please help me, i would also like if you knew how to make it that there are never same numbers in the table
for i = 1, 16 do
table.insert(wronganswers, math.random(chosen.answer - 8, chosen.answer + 8))
end
for i, v in pairs(wronganswers) do
if v == chosen.answer then
table.remove(wronganswers, v)
end
end
print(chosen.answer)
print(wronganswers)