Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How would I make a password script?

Asked by 7 years ago

I want to make a script where the screen says "password" and you click it and enter a given password and press enter and if it's right, it does something else. How would I make this happen? I know screen GUIs won't let you type stuff into it, but if I connected a different script that you COULD type into on top of the password box and let you type into there, would it work?

1 answer

Log in to vote
4
Answered by
theCJarmy7 1293 Moderation Voter
7 years ago

There is another type of gui that can use textBoxes. As for the password, you do that like this.

textBox = --put a textBox here
code = "Codey" --the code

textBox.FocusLost:connect(function() --fires when the player de-selects the box
    if textBox.Text:lower() == code:lower() then --:lower() is the text in all lowercase
        print"They typed it right!"
    else print"they typed it wrong :("
    end
end)

TextBox, FocusLost, and string.lower().

0
Slow down I:< User#11440 120 — 7y
Ad

Answer this question