ImageTransparency wont change

Hello, I’m trying to change the image transparency of this image label through a module, but the image transparency won’t change, everything else works.

local module = {}
		function module.GoopEffect(plr)
			r = math.random(1,3)
			print("f")
			if r == 1 then
				plr.PlayerGui.Goop.vom1.ImageTransparency = 0
				wait(4)
			for i = 1,20 do 
				print("1")
				wait(.05)
				plr.PlayerGui.Goop.vom1.ImageTransparency = plr.PlayerGui.Goop.vom1.ImageTransparency + 0.08 
			end
			elseif r == 2 then
				plr.PlayerGui.Goop.vom2.ImageTransparency = 0
				wait(4)
			for i = 1,20 do
				print("2") 
				wait(.05)
				plr.PlayerGui.Goop.vom2.ImageTransparency = plr.PlayerGui.Goop.vom2.ImageTransparency + 0.08 
			end
			elseif r == 3 then
				plr.PlayerGui.Goop.vom3.ImageTransparency = 0
				wait(4)
				for i = 1,20 do 
				print("3")
				wait(.05)
				plr.PlayerGui.Goop.vom3.ImageTransparency = plr.PlayerGui.Goop.vom3.ImageTransparency + 0.08 
				end
			end
		end
return module
1 Like

Based on the fact that you take a player as an argument, I assume this is called from the server, or another client.

No one except a client themselves can edit a GUI. Use RemoteEvents and/or require this code in a LocalScript.

The code itself works on my machine, so there’s nothing wrong with your algorithm.