I've been having problems with a GUI that's pretty simple. All it does is once someone enters in the correct code into the input, the script prints Success. If they do not enter the proper code the input box is set to say invalid. Neither parts of the script are working and I cannot figure out why. I'm getting no errors in output or in the script. What's wrong with it?
script.Parent.MouseButton1Click:connect(function()
if script.Parent.Parent.Input.Text == "Code" then
print("Success")
else
script.Parent.Parent.Input.Text = 'Invaild'
end
end)
Edit: This is a local script and everything is in starter GUI. I can see the GUI and input text but nothing happens even if the code is correct or incorrect.

5 comments
Post more information. Is it a LocalScript?
Have you tried using a breakpoint to see what it's doing?
No, I'll try that.
so is the code just 'Code' or something else? (like numbers)
Is the LocalScript a child of the button? I've had issues in the past with .Text not returning any values. Although yours is just not working. Check to make sure your script isn't disabled.