i am trying to make a code system but its not working what the "code system" means is there is like 2 textbox and a player can input in textbox number 1 or 2 and the name of the textbox is the same for both i made this simple code but it seems to not be working:

Problem:

when i put the valid code in, 'OKAY' wont apper

local Output = script.Parent.Output
local inputs = script.Parent.inputs

c.MouseButton1Click:Connect(function()
	for i, Cells in pairs(inputs:GetChildren()) do
		
		if Cells.Text == 'das' then
			Output.TextLabel.Text = 'OKAY'
			
			
			
			
		else
			Output.TextLabel.Text = 'not a valad code'
			
		end
	end	
end)

no errors nothing!

*local script

9 comments

0

I'm guessing that it's on the server side. However, you can only get TextBox text in a LocalScript. You'll have to use RemoteEvents to get past that.

0

Try printing each individual value i.e. (x,y,z)

0

?

0

You should be making a RemoteFunction call to the Server to handle code-recognition & rewarding; subsequently, mark down inputted codes with DataStoreService.

0

As Jesse suggested, you can debug your code with a print statement. By adding "print(Cells.Text)", you can visualize what the code is evaluating.

0

Side-note: In proper context, "Cells" should be named "Cell".

0

i figured it out

0

you add a break

0

valad code