Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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!

3 comments

0

Try changing " GetChildren" to " GetDescendants".

0

Still doesn't work

0

Try using the script I gave you.

1 answer

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																							       

2 comments

0

Still doesnt work :(

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.