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

May somebody help me identify the error?

ImageTransparency it's not taking effect, everything else prints out telling me that the script compiled successfully, yet ImageTransparency won't affect the ImageLabels.

local Players = game:GetService("Players")
function onPlayerAdded(player)
	print("oPA Sucessful")
	
local intro = game.StarterGui.ScreenGui
local intro_f = intro.Frame
local x_1 = intro_f.x_1
local x_2 = intro_f.x_2
local v_1 = intro_f.v_1
local n_2 = intro_f.n_2
local r_1 = intro_f.r_1
local d_1 = intro_f.d_1
local x_2 = intro_f.x_2
print("All assests aquired")

x_1.ImageTransparency = 0.9
wait(0.15)
x_1.ImageTransparency = 0.8
wait(0.15)
x_1.ImageTransparency = 0.7
wait(0.15)
x_1.ImageTransparency = 0.6
wait(0.15)
x_1.ImageTransparency = 0.5
wait(0.15)
x_1.ImageTransparency = 0.4
wait(0.15)
x_1.ImageTransparency = 0.3
wait(0.15)
x_1.ImageTransparency = 0.2
wait(0.15)
x_1.ImageTransparency = 0.1
wait(0.15)
x_1.ImageTransparency = 0.0
wait(0.15)
print("x_1 Sucessful")

end
Players.PlayerAdded:connect(onPlayerAdded)

1 comment

0

You are only editing the gui in startergui. Not the one in the player's playergui.

1 answer

✓ Accepted answer

Just replace game.StarterGui.ScreenGui with player.PlayerGui.ScreenGui, and also make sure the script is in a regular script.

local Players = game:GetService("Players") --Tab codes correctly so it's easier to read.
Players.PlayerAdded:connect(function(player) --You can also use events like this, but if you do it this way, you need to have a ")" at the end of "end".
	print("oPA Sucessful")

	local intro = player.PlayerGui.ScreenGui
	local intro_f = intro.Frame
	local x_1 = intro_f.x_1
	local x_2 = intro_f.x_2
	local v_1 = intro_f.v_1
	local n_2 = intro_f.n_2
	local r_1 = intro_f.r_1
	local d_1 = intro_f.d_1
	local x_2 = intro_f.x_2
	print("All assests aquired")

	for transparency = 0,1,-0.1 do --Use a loop instead. It's much more easier.
		x_1.ImageTransparency = transparency
		wait(0.15)
	end

	print("x_1 Sucessful")

end)

Hope it helps!

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