Scripting Helpers is winding down operations and is now read-only. More info→
Log in to vote

Visible and active property set to true, but I can't interact nor see it, how do I fix this?

Asked by 1 year ago

Hello, I have a script that sets a textbutton's visible and active property to true. But I don't see the textbutton. And my script is a localscript.

I tried searching many times on how I could fix this but I didn't find the right answer.

Here is the code:

game.StarterGui.FloatyBrickConversation.ImageLabel.Response1.Active = true
game.StarterGui.FloatyBrickConversation.ImageLabel.Response2.Active = true
game.StarterGui.FloatyBrickConversation.ImageLabel.Response1.Visible = true
game.StarterGui.FloatyBrickConversation.ImageLabel.Response2.Visible = true

Please help me.

1 answer

Log in to vote
Answered by
xXMadonXx 190
1 year ago
Edited 1 year ago

You need to edit the Gui of the player and not the StarterGui. By editing the StartGui (server-side) only new players that join are going to see the edits, as StarterGui copys its children to the player because it is only a container. Also your localscript does nothing as it can not really edit StarterGui except for you.

For more info read [StarterGui as a Container]: StarterGui Documentation

Edit: PlayerGui is located under the Player. To access it (locally):

game:GetService("Players").LocalPlayer.PlayerGui -- your GUIs from StarterGui are children from player.PlayerGui

You can also see this ingame (or when you test) and open your Player in the Explorer.

And how exactly do I edit the gui of the player? ghostgamer90391 9 — 1y
See edit xXMadonXx 190 — 1y
Thank you so much. ghostgamer90391 9 — 1y
One problem though, I can't activate the button that I turned visible and active. ghostgamer90391 9 — 1y
View all comments (2 more)
probably another ui part is not active which is above the button xXMadonXx 190 — 1y
Sorry for late response, there's no other ui part over it. ghostgamer90391 9 — 1y

Answer this question