Text not changing after 3 seconds after the shop Gui is opened

  1. What do you want to achieve? The text changing when the shop Gui is opened

  2. What is the issue? The text doesn’t change after 3 seconds

  3. What solutions have you tried so far? Checking through my script to see if I did something wrong

This local script is a child of a text label

if script.Parent.Parent.Parent.Visible == true then
   wait(3)
   script.Parent.Text = "What would you like to buy?"
end

Thanks!

So, the problem is that it will check it as soon as the player joins the game and not repeat itself when the GUI is actually open. However, there’s a simple way to make it work correctly. That’s using the GetPropertyChangedSignal() function. Here’s how you do it:

script.Parent.Parent.Parent:GetPropertyChangedSignal("Visible"):Connect(function()
    if script.Parent.Parent.Parent.Visible == true then
       wait(3)
       script.Parent.Text = "What would you like to buy?"
    end
end)
1 Like