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
Try changing " GetChildren" to " GetDescendants".
Still doesn't work
Try using the script I gave you.