How can I make text not start to display until A GUI is visible

. What do you want to achieve? I want to have A typewriter effect In a Text Table when A Player First looks at it.

  1. What is the issue? The Text already writes itself before the UI is visible. To see what I mean click the Yellow circle in the middle of the screen to see that the it has already started and finished.
    The Game is here.

  2. What solutions have you tried so far? I have tried using A few different methods or scripts to do this. I have also tried to say if the frame is not visible then do not make the text.

if script.Parent.Visible == true then
local text = "If you get this Amazing gamepass ALL Suggestios and Ban Appeals will be seen and answered first!"
for i = 1, #text do
	script.Parent.Text = string.sub(text, 1, i)
	wait(0.05)
end	
end

I also tried changing what had to be visible. Sometimes the script did nto work or yeilded the same result.

How is the gui becoming visible?
If it is a button add a wait() or something.

Hey!

I am sure we can figure this one out!

What are you using to make the GUI visible?

A problem might be that this code is not attached to any event. If you wanted to detect when the GUI turns to visible you could do:

script.Parent:GetPropertyChangedSignal("Visible"):Connect(function()
       if script.Parent.Visible == true then
          for i = 1, #text do
	     script.Parent.Text = string.sub(text, 1, i)
         wait(0.05)
end
end	
end)

A button is being used,
The code you used made the texted not appear at all (I did define text)

I fixed it!!!
So…
I changed the button code so that if pressed it makes the text box (not just its parent) visible:

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.PriorityFrame.Visible = true
	script.Parent.PriorityFrame.GamepassDescription.Visible = true
	script.Parent.Selectable = false
	script.Parent.Parent.Parent.BanAppeal.BanButton.Selectable = false
	script.Parent.Parent.Parent.Bugs.BugButton.Selectable = false
	script.Parent.Parent.Parent.FAQ.FAQButton.Selectable = false
	script.Parent.Parent.Parent.Suggestions.SuggestionsButton.Selectable = false
end)

I then changed the script code to the original.

Like I said, the code was not attached to any event.

1 Like