#weird repeating print statement
12 messages · Page 1 of 1 (latest)
this is the function responsible for the error
local function decideOptions()
local randomNumRed = math.random(1, #characterList)
local randomNumBlue = math.random(1, #characterList)
local choices = {}
if randomNumRed == randomNumBlue then
decideOptions()
else
for i, v in pairs(characterList) do
if i == randomNumRed or randomNumBlue then
table.insert(choices, v)
end
end
end
print(choices)
return choices
end
return decideOptions()
also your if statement is a bit off
if i == randNumRed or i == randNumBlue then
returning decideOptions() nearly crashes the game
did u fix your if statments
also how many characters are in characterslist?
if its just 1 then both of the random numbers are always gonna be 1 because theres no other number they can return with only 1 character in the list and your 1st if statement checks if both numbers equal each other, it runs the function again and then in that function the same thing happens creating a loop that crashes your game
yes i fixed the
@random anchor theres 2 characters for that reason