I recently got an admin menu GUI that shows up on every player's screen and it is not compatible with my last GUI Locker, so I made a new one, and it doesnt seem to work. I made it in a really weird way which I will explain.
this is where everything is located ::
workspace>StarterGui>AdminLock>TextBox>Script
This is the script that is in Script ::
if script.Parent.Text == ("112Aa3C")
then
script.Parent.Visible = false
end
I tried to make it as simple as possible so I didn't have to to a bunch of work, but essentially what is is doing, is there is supposed to be a textbox over the admin GUI buttons, and when you input the proper text, the script detects that and sets the TextBox's Visibility to ~nil
The issue is, nothing is happening. I wasnt sure if I was supposed to use a localscript or what, but I couldn't figure it out. I can put the text in but the script is not detecting the input.
StarterGui>ScreenGui>AdminLock>TextBox>LocalScript
Any coding GUI related MUST be a Local Script.
local textbox = script.Parent textbox:GetPropertyChangedSignal('Text'):Connect(function() if textbox.Text == "112Aa3C" then -- No brackets! '()' textbox.Parent.Visible = false end end)
I created this simple script just for testing, but it is what you are looking for, and will solve your problem.
--Create a localscript, put this script in it, and put the script in your TextBox local code = "InsertCodeHere" -- This is what you want the user to enter. script.Parent.FocusLost:Connect(function (property) if script.Parent.Text == code then local part1 = Instance.new("Part",game.Workspace) part1.Anchored = true else script.Parent.Text = "Code not accepted." end end)
Basically what this script does, is waits for the TextBox to lose focus (Pressing enter, clicking away, etc). Once focus is lost, it will determine weather or not TextBox.Text = code. If so, then create a part (or in your case, make invisible or whatever), if not, then it makes the TextBox say "Code not accepted." so players know it wasn't accepted.
The problem with your script is there was no way for it to even detect if the text value changed. so for you the script would be similar to this
local code = "InsertCodeHere" -- This is what you want the user to enter. script.Parent.FocusLost:Connect(function (property) if script.Parent.Text == code then script.Parent.Visible = false else script.Parent.Text = "Code not accepted." end end)
EDIT: Seems incapaz beat me too it. His script with "textbox:GetPropertyChangedSignal('Text'):Connect(function()" would actually be better, as it will only detect if the text value was changed. Use his for a better solution.