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
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.
Try printing each individual value i.e. (x,y,z)
?
You should be making a RemoteFunction call to the Server to handle code-recognition & rewarding; subsequently, mark down inputted codes with DataStoreService.
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.
Side-note: In proper context, "Cells" should be named "Cell".
i figured it out
you add a break
valad code