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

How do I make my start button fade out all of the guis?

Asked by 5 years ago

Hello.

I am currently trying to make a start menu and whenever the start the button is clicked it should fade out all of the guis. Heres what I have so far but at the moment it's not working.

local LeftFrameBG = {
    script.parent.LeftFrame;
    script.parent.LeftFrame.Customize;
}

local LeftFrameText = {
        script.Parent.LeftFrame.Doubloons;
        script.Parent.LeftFrame.Level;
        script.Parent.LeftFrame.Username;
}

local RightFrame = script.Parent.RightFrame

local function fadeOutBG()
    for i = LeftFrameBG.BackgroundTransparency, 1, .1 do
        wait(.1)
        LeftFrameBG.TextTransparency = i
    end
end


script.Parent.StartButton.MouseButton1Click:connect(function ()
    fadeOutBG()
end)

0
I think you should do "-.1" instead of ".1", haven't coded in a while but that seems right to me xEmmalyx 285 — 5y
0
That doenst seem to do it for me. where should this script be? In the gui or under the start button? OurAuthority 5 — 5y
0
It depends where you want it to be, and where the script locates the GUI you want to change. Araknala 14 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago
local LeftFrameBG = {
    script.parent.LeftFrame;
    script.parent.LeftFrame.Customize;
}

local LeftFrameText = {
        script.Parent.LeftFrame.Doubloons;
        script.Parent.LeftFrame.Level;
        script.Parent.LeftFrame.Username;
}

local RightFrame = script.Parent.RightFrame

local function fadeOutBG()
    for i = LeftFrameBG.BackgroundTransparency, 1, .1 do
        wait(.1)
        LeftFrameBG.TextTransparency + .1
    end
end


script.Parent.StartButton.MouseButton1Click:connect(function ()
    fadeOutBG()
end)

Check the FOR loop. You didn't set how much transparency you want to add, though, you set the loop. If this doesn't work, then change TextTransparency to BackgroundTransparency, I am unsure if you wanted those the same. You should put this script to wherever you had it first, or in a position of location the objects in the script. If this helped, maybe give me an UPVOTE, or accept this ANSWER! :D

0
This also doesnt seem to work. Whenever I add the + It says that it's expecting a = OurAuthority 5 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

If all of your GUI elements are fully non-transparent then this solution will work for you. https://gyazo.com/2bfecdb1c39f885ab54f8e447d704b8c

Note: i'm still doing early tests and I thought I would share this because it worked for me. If it doesn't support cloning from another service then leave it in StarterGui's, toggle off reset on spawn, disable the screen Gui and instead enable it within the script so it doesn't get in the way.

Answer this question