I'm learning script, kind of having trouble with this script. I believe I'm doing wrong...
function codeentry() if script.Parent.Parent.Code.Text == "1337" then script.Parent.Parent.Code.Text = "Correct" wait(2) script.Parent.Parent.Parent.Parent.Frame:TweenPosition(UDim2.new(-0.5, 0, 0.25, 0), "Out", "Elastic", 2.5) else if script.Parent.Parent.Code.Text == not "1337" then script.Parent.Parent.Code.Text = "Incorrect" script.Parent.Parent.Parent.Parent.Frame:TweenPosition(UDim2.new(-0.5, 0, 0.25, 0), "Out", "Elastic", 2.5) end end end script.Parent.MouseButton1Up:connect(codeentry)
I'm trying to make the text to say incorrect when you enter code that is not "1337"?
The term "== not 1337" doesn't seem like it would work. I suggest "~= 1337". Also, you're using else, then if, so the ~= 1337 doesn't even apply to this. Here is a fixed version (a least, I think it's fixed.):
function codeentry() if script.Parent.Parent.Code.Text == "1337" then script.Parent.Parent.Code.Text = "Correct" wait(2) script.Parent.Parent.Parent.Parent.Frame:TweenPosition(UDim2.new(-0.5, 0, 0.25, 0), "Out", "Elastic", 2.5) else --This says if it's anything besides 1337, then do the following script.Parent.Parent.Code.Text = "Incorrect" script.Parent.Parent.Parent.Parent.Frame:TweenPosition(UDim2.new(-0.5, 0, 0.25, 0), "Out", "Elastic", 2.5) end end end script.Parent.MouseButton1Up:connect(codeentry)