Children of GUI not Becoming Transparent

What do I want to achieve? I am currently attempting to create a function where the children of a folder in a screenGUI’s transparency becomes 0. This script is a local script located inside of a screenGUI in StarterGUI.

What is the issue? It displays that the value has changed to 0 when I test, but has not appeared on the client nor the server.

The script:

local function appear()
	for _, child in ipairs(game.StarterGui.StartDialogue.Frame:GetChildren()) do
		if child:IsA("ImageLabel") then
			child.BackgroundTransparency = 0
		end
	end
end

appear()

The StarterGUI:
image

1 Like

The current code will change the transparency only in the StarterGui… any players’ characters already in the game won’t be affected until they reset their character. (as this is when the gui is loaded.

You can try:

local player = game:GetService("Players").LocalPlayer
local pGui = player:WaitForChild("PlayerGui")

local function appear()
	for _, child in ipairs(pGui.StartDialogue.Frame:GetChildren()) do --Changed reference to pGui
		if child:IsA("ImageLabel") then
			child.BackgroundTransparency = 0
		end
	end
end

Or you can change the Players.CharacterAutoLoads to false then run your original code (to change the StarterGui) and then call player:LoadCharacter each time you want the character to load.

1 Like

This makes sense now. Thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.