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

How do you make a fade-in frame when play button pressed?

Asked by 2 years ago

I'm making a playbutton that's gonna teleport you to another place when pressed. I want a smooth trasition to my upcoming loading screen that I'm gonna make later so I would appreciate some help to get this headache out of the way.

NOTE: The scripts that have anything to do with sounds work.

I've tried multiple ways and none have worked yet.

The code:

local BlackFading = game.StarterGui.LoadingScreen.FirstBlack

PlayButton.MouseButton1Down:Connect(function() game.StarterGui.PlayMenu.OnlineClicked.Value = true script.Parent.OnlineClick:Play() script.Parent.ImageColor3 = Color3.new(0, 1, 0) wait(1) script.Parent.ImageColor3 = Color3.new(255,255,02550) wait(0.1) wait(3)

-- Everything above this works --

for i = 1,100 do
    BlackFading.BackgroundTransparency -= 1 -- First of black screen,
    wait(0.01)
end
wait(3)
BlackFading.Parent.DramaticHit:Play()  -- A dramatic hit sound plays (works)
wait()
for i = 1,100 do
    BlackFading.ImageLabel.ImageTransparency -= 1 -- my group icon appears
    wait(0.01)
end
for x = 1, 0, -0.1 do
    workspace.SOUNDS.GARAGE.Volume = x -- background music fades away(works)
    wait(0.01)
end
for i = 1,100 do
    BlackFading.TextLabel.TextTransparency -= 1 -- a text below the icon appears
    wait(0.01)
end

end)
0
Just use TweenService MattVSNNL 620 — 2y
0
I don't know how TweenService work though... freakboy554 0 — 2y

1 answer

Log in to vote
0
Answered by
Befogs 113
2 years ago

You were not very clear on how your script fails to work, however since you want to fade the transparency you should do it by increments. Since we know transparency 1 is fully transparent and 0 is fully opaque, you likley want to change your increment from 1 to 1 / 100 to achieve your desired results.

Ad

Answer this question