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

Leaderboard fade works in studio but not in client?

Asked by
wackem 50
9 years ago

No errors in either studio or the dev console in client. I can't seem to figure out the problem, all variables are defined, and like I said, nothing errors. Here's the code chunk:

game:GetService("UserInputService").InputBegan:connect(function(inputObject, gameProcessedEvent)
    if inputObject.KeyCode == Enum.KeyCode.F then
        for _,v in pairs(player.PlayerGui.Leaderboard:GetChildren()) do
            if v.Name:sub(1, 4):lower() == "line" then
                if v.Transparency < 1 then
                for i = 0, 1, .1 do
                    wait(.1)
                    v.Transparency = i
                end
            else
                for i = 0, 1, .1 do
                    wait(.1)
                    v.Transparency = v.Transparency - i
                end
                end
            end
        end
    end
end)
1
Is this a LocalScript, and where is it? I see too many questions like this with the same answer all the time. User#6546 35 — 9y
0
Well, why don't you use KeyDown? ScriptFusion 210 — 9y
0
@ScriptFusion KeyDown is deprecated. It is recommended to use UIS or CAS. LetThereBeCode 360 — 9y

Answer this question