So i wanna make a script where players can join matches with a code. 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
local number = tostring(script.Parent.Parent.Parent.CodeInput.Text)--CodeInput is the textbox where players put in the code
local Ncode= tostring(code.Value)
if number == Ncode then
print("Joined Match!")
else
print("Invalid Code")
end
end
end
end
end
end
end
end)
Whenever i put in the Code input box the same value as the match code, it still prints invalid code. Someone please help!

4 comments
Whats the line 9 for?
to find the match code string value
Can you try to print the numer print(number) and print the Ncode print(Ncode)
When i do that number equals nothing???