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

I need a fading in and out frame. I already tried but i need help. Anyone can help?

Asked by 4 years ago

Here the script i tried..

local playergui = game.Players.LocalPlayer.PlayerGui

script.Parent.MouseButton1Click:Connect(function()
    game:GetService("ReplicatedStorage").AdultEvent:FireServer()
    wait(.01)
    script.Parent.Parent.Parent.Parent.Visible = false
    local fadingClone  = playergui.BlackFadingGui.Frame:Clone()
    fadingClone.Parent = playergui.BlackFadingGui
    fadingClone.Visible = true
    wait(.1)
    for loop = 0.01, 15 do
      wait (.1)
       fadingClone.BackgroundTransparency = loop/5
        game:GetService ("RunService"). Stepped:Wait()
        wait(0.1)


    end
end)


0
Three different wait statements in 1 loop. Why? And the loop counts 0.01, 1.01, 2.01... up to 14.01. What is Transparency of 14.01/5 supposed to be? And why is one of the waits waiting on the physics simulation Stepped event for a UI update? I'm scratching my head trying to figure out how you even came up with this. EmilyBendsSpace 1025 — 4y
0
i got it from the community just help me fix it, i need it to fade in and out trickortreat333444 -6 — 4y
0
Since I'm not sure what your Script.Parent's are leading toward it's hard to help you out. Try assigning variables to your objects to make it easier for you to read and understand and come back with code that is easier to read. That way people can actually help you out. waifuSZN 123 — 4y

Answer this question