Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

i am trying to make a code system but its not working?. no errors nothing(GUI)

Asked by 3 years ago
Edited 3 years ago

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

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. Raccoonyz 1092 — 3y
0
Try printing each individual value i.e. (x,y,z) JesseSong 3916 — 3y
0
? Retallack445 75 — 3y
0
You should be making a RemoteFunction call to the Server to handle code-recognition & rewarding; subsequently, mark down inputted codes with DataStoreService. Ziffixture 6913 — 3y
View all comments (5 more)
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. Ziffixture 6913 — 3y
0
Side-note: In proper context, "Cells" should be named "Cell". Ziffixture 6913 — 3y
0
i figured it out Retallack445 75 — 3y
0
you add a break Retallack445 75 — 3y
0
valad code WideSteal321 773 — 3y

Answer this question