Repeat script is not working

I’m making a verification system for my game to fend off bots.

Heres the script: (The last part where it repeat doesnt work)

local numbers = {1,2,3,4,5,6,7,8,9,0}
local numberNames = {"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Zero"}
local RandomButton = {1,2,3,4}
local QuestionLabel = script.Parent.QuestionLabel
local CorrectNum = script.Parent.CorrectNum
local t1 = script.Parent.t1
local t2 = script.Parent.t2
local t3 = script.Parent.t3
local t4 = script.Parent.t4
local QuestionLabelAnswer
local Correct

CorrectNum.Value = numberNames[math.random(1,#numberNames)]
QuestionLabel.Text = "Choose number: "..CorrectNum.Value

if CorrectNum.Value == "One" then
	QuestionLabelAnswer = 1
elseif CorrectNum.Value == "Two" then
	QuestionLabelAnswer = 2
elseif CorrectNum.Value == "Three" then
	QuestionLabelAnswer = 3
elseif CorrectNum.Value == "Four" then
	QuestionLabelAnswer = 4
elseif CorrectNum.Value == "Five" then
	QuestionLabelAnswer = 5
elseif CorrectNum.Value == "Six" then
	QuestionLabelAnswer = 6
elseif CorrectNum.Value == "Seven" then
	QuestionLabelAnswer = 7
elseif CorrectNum.Value == "Eight" then
	QuestionLabelAnswer = 8
elseif CorrectNum.Value == "Nine" then
	QuestionLabelAnswer = 9
elseif CorrectNum.Value == "Zero" then
	QuestionLabelAnswer = 0
end

Correct = RandomButton[math.random(1,#RandomButton)]

if Correct == 1 then
	t1.IsCorrect.Value = true
	t1.Number.Text = QuestionLabelAnswer
elseif Correct == 2 then
	t2.IsCorrect.Value = true
	t2.Number.Text = QuestionLabelAnswer
elseif Correct == 3 then
	t3.IsCorrect.Value = true
	t3.Number.Text = QuestionLabelAnswer
elseif Correct == 4 then
	t4.IsCorrect.Value = true
	t4.Number.Text = QuestionLabelAnswer
end

for i,v in pairs(script.Parent:GetChildren()) do
	if v.Name == "t1" or v.Name == "t2" or v.Name == "t3" or v.Name == "t4" then
		if v:WaitForChild("IsCorrect").Value ~= true then
			if QuestionLabelAnswer ~= v:WaitForChild("Number").Text then
				v:WaitForChild("Number").Text = numbers[math.random(1,#numbers)]
				if v:WaitForChild("Number").Text == QuestionLabelAnswer then
					repeat v:WaitForChild("Number").Text = numbers[math.random(1,#numbers)] until v:WaitForChild("Number").Text ~= QuestionLabelAnswer
					print("Retrying...")
				end
			end
		end
	end
end

This can easily be bypassed by simply subbing the textlabel text. Instead try using images and tell the user to manipulate the text of the image. It’s way more Efficient

Yeah, but can I have an answer?

And where could I even grab these images from? I’m not upload hundreds of decals.

Besides, this is for bots, and i’m planning to make it more secure.

I have been trying to resolve this issue, but I cannot find a solution still.

I meant bots can bypass this

It’s your only choice really.

What if they just grab the IDs of all the images, store them in a table, and correlate them with certain texts?

The creator could just use the rbxgameasset method so the image can’t be stored plus as a bonus, unstealable

1 Like

That’s a good point. Nevermind.

STILL, nobody helped with the issue. I’m asking for an answer not a suggestion.