I'm trying to make so when a button is clicked and it becomes invisible the NPC talks.
('a' is the name of the NPC)
while game.StarterGui.MainGui.PlayButton.Visible == true do
if game.StarterGui.MainGui.PlayButton.Visible == false then
game:GetService("Chat"):Chat(game.Workspace.a.Head, "EnterTextHere", Enum.ChatColor.White)
wait(2)
end
end
I have no idea what I'm doing wrong, can somebody help?
(MainGui is the ScreenGui) (PlayButton is the text button)

1 comment
when in-game players have a "PlayerGui" instance descended to them, you should be checking this instead of the StarterGui