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

May somebody help me identify the error?

Asked by
Xianon 105
9 years ago

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)

0
You are only editing the gui in startergui. Not the one in the player's playergui. EzraNehemiah_TF2 3552 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

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!

Ad

Answer this question