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

Why is the text inside a text box nothing when it clearly has something in it?

Asked by 3 years ago

So I'm making a join match script where I need the text inside a text box to see if it matches with any codes. So i made the script print them match code and the text inside the text box to test it. It printed the match code but the text inside the text box came out as nothing! Here is the script:

script.Parent.MouseButton1Click:Connect(function()


    for _,v in pairs(game.Workspace:GetChildren()) do
        if v.ClassName == "Folder" then
            for _,matches in pairs(v:GetChildren()) do
                if matches.ClassName == "Folder" then
                    for _,code in pairs(matches:GetChildren())do
                        if code.Name== "MatchCode" then
                            --CodeInput is the textbox where players put in the code

                            local Ncode= code.Value
                            print(script.Parent.Parent.Parent.CodeInput.Text)
                            print(Ncode)



                        end
                    end
                end
                end
        end
    end

Someone please help!

0
Try changing " GetChildren" to " GetDescendants". uiuiuiuihauahua67 15 — 3y
0
Still doesn't work COOLGUY16T 37 — 3y
0
Try using the script I gave you. uiuiuiuihauahua67 15 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

This script might work.

script.Parent.MouseButton1Click:Connect(function()

  for _,v in pairs(game.Workspace:GetDescendants()) do
   if v:IsA("Folder")  then
      for _,matches in pairs(v:GetDescendants()) do
           f matches:IsA("Folder") then
              for _,code in pairs(matches:GetDescendants())do
                   if code:IsA("MatchCode") then
                       --CodeInput is the textbox where players put in the code--

                        local Ncode= code:FindFirstChild("MatchCode")
                        print(script.Parent.Parent.Parent.CodeInput.Text)
                        print(Ncode)



                    end
                end
            end
            end
    end
end                                                                                                
0
Still doesnt work :( COOLGUY16T 37 — 3y
0
Maybe you need to check everything and make sure everything are alright. If not, you may use while loops instead for using in pairs loop. uiuiuiuihauahua67 15 — 3y
Ad

Answer this question