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!
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