Script doesn't work?

I have a GUI that has a frame inside, and inside the frame is a text label, I want to make it so that when you say something in chat this text label becomes visible “it is normally visible = false” but for some reason when I write the message in chat nothing happens, here is the server script I’m currently using:

game.Players.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(msg)
		if msg == "hello" then
			game.StarterGui.ScreenGui.Frame.SecretText.Visible = true
		end
	end)
end)
1 Like

it is not the starter gui. that is the source the player gets its gui objects from and inserts it into their playerGui. so what you need to do is change the 4th line of code to

plr.PlayerGui.ScreenGui.Frame.SecretText.Visible = true
2 Likes

Ah, seems to be working now, thank you so much!!

1 Like