Problems creating a password with TextBox!

im crying right now because this doesn’t work.
Basically, I want to do a employee computer for my cafe:


When you use the password “password”, click enter and press the logo, then script.parent.parent should be VISIBLE FALSE.

the script in blue is the one managing that.

script.Parent.Parent.ImageButton.MouseButton1Click:Connect(function()
	if script.Parent.TextBox.Text == "password" then
		script.Parent.Parent.Visible = false
	end
end)

If someone ignores me, im going to cry, thank you.
sincerely yours,
vayouls.

Changes on UI elements don’t replicate to the server if done on the client. You need a LocalScript to handle it.

Add a new LocalScript in StarterPlayerScripts and paste this inside:

local SurfaceGui = workspace:WaitForChild("Monitor"):WaitForChild("SurfaceGui")
local Frame = SurfaceGui.Frame
local TextBox = Frame.TextBox
local ImageButton = Frame.ImageButton

ImageButton.MouseButton1Click:Connect(function()
	if TextBox.Text == "password" then
		Frame.Visible = false
	end
end)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.