Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

ImageTransparency changes in properties but not on screen?

I have a script where every time you click on a brick, the Image on screen will change transparency, it will show that the transparency changes in properties but not on screen. I have Script in click detector in part, and I have ImageLabel in a ScreenGui under StarterGui. Script:

local CD = script.Parent
game.StarterGui.ScreenGui.ImageLabel.ImageTransparency = 1

CD.MouseClick:connect(function(click)
	game.StarterGui.ScreenGui.ImageLabel.ImageTransparency = game.StarterGui.ScreenGui.ImageLabel.ImageTransparency - 1
end)
 -- more than one variables gets me confused sometimes

1 answer

This is happening because your changing the transparency of the frame through the "StarterGui".

The StarterGui and PlayerGui are 2 different things. StarterGui is the gui the player starts with, so they will only see its changes when they respawn. PlayerGui is the gui the player see's ingame.

It would instead be this:

local CD = script.Parent
game.Players.LocalPlayer.PlayerGui.ScreenGui.ImageLabel.ImageTransparency = 1

CD.MouseClick:connect(function(click)
    game.Players.LocalPlayer.PlayerGui.ScreenGui.ImageLabel.ImageTransparency = game.Players.LocalPlayer.PlayerGui.ScreenGui.ImageLabel.ImageTransparency - 1
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.