Open UI on chat not working

Hi!
This is one of the worst glitches I have. I’m trying to make an Admin Panel, but it’s not working.
I have 2 non working scripts:
1: OnChatted not working
(I don’t know how to make a button that only appears for devs.)

local plr = game.Players.LocalPlayer 
plr.Chatted:Connect(function(msg) 
	if msg:lower() == ">>/openPanel" then
		plr.PlayerGui.Panel1.LoginFrame.Visible = true 
	end
end)

Location: StarterPlayScripts, LocalScript
2: Admin panel password broken
Location: ServerScript inside of the TextBox

while wait() do
	local input = script.Parent.TextBox.Text
if input == 1 then
	script.Parent.InputValid.Visible = true
	script.Parent.InputValid.TextColor3 = Color3.fromRGB(98, 255, 71)
	wait (3)
	script.Parent.Parent.Visible = false
	script.Parent.Parent.Parent.AdminMain.Visible = true

	end
	end

I wouldn’t do this, I would instead set up a FocusLost event that will fire when the player loses focus.

local input = script.Parent.TextBox

input.FocusLost:Connect(function()
    if input.Text == '1' then
        print('Yes!')
    end
end)

Alternatively, you can use a changed event which will fire when the text is changed.

local input = script.Parent.TextBox

input:GetPropertyChangedSignal('Text'):Connect(function()
    if input.Text == '1' then
        print('Yes!')
    end
end)
1 Like
local devs = { } --put some ids in here and separate them with a comma
local player = game.Players.LocalPlayer

if table.find(devs,player.UserId) then
    Button.Visible = true -- Do your thing here.
end
1 Like

How would I make it so it checks if thew “Log In” button is pressed?

local submit = script.Parent.TextButton -- Your button here
local input = script.Parent.TextBox

submit.MouseButton1Click:Connect(function()
    if input.Text == '1' then
        print('Yes!')
    end
end)


that did nothing. i only changed the key.

Can I see your explorer? Make sure you also changed the '1' to the correct password

1 Like
local submit = script.Parent.Parent.LOGIN -- Your button here
local input = script.Parent.TextBox

submit.MouseButton1Click:Connect(function()
	if input.Text == 'h5y89se5HJUYHSE54cyfgd65' then
		script.Parent.Parent.Parent.Parent.AdminMain.Visible = true
	end
end)
-- 68368346939529357389639836384683751341391274135781242879912348138949356742698524823457243589

image

It’s because input is defined incorrectly

local submit = script.Parent.Parent.LOGIN -- Your button here
local input = script.Parent.Parent.Textbox

submit.MouseButton1Click:Connect(function()
	if input.Text == 'h5y89se5HJUYHSE54cyfgd65' then
		script.Parent.Parent.Parent.Parent.AdminMain.Visible = true
	end
end)


Still did nothing/.


local submit = script.Parent.Parent.LOGIN -- Your button here
local input = script.Parent.Parent.TextBox

submit.MouseButton1Click:Connect(function()
	if input.Text == 'h5y89se5HJUYHSE54cyfgd65' then
		script.Parent.Parent.Parent.Parent.AdminMain.Visible = true
	end
end)
-- 68368346939529357389639836384683751341391274135781242879912348138949356742698524823457243589

Are there any errors showing up in the output? Also could you show me where AdminMain is located in your explorer?

image
(“Gradient” is located in a GUI in StarterGUI

Is AdminMain outside the ScreenGui?

no. it is in the same UI DDDDDD

image

Your using a server script to detect locally inputted text.

1 Like

I thought you were using a local script, that’s why I was unsure why it wasn’t working for you

1 Like