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

How to smoothly change the value of fogend so it doesn't just jump right to the fog density?

Asked by 2 years ago

Hello again. Sorry for asking 2 questions so quickly but this should be the last one for a while. Here I have this script. It increases the fog density whenever an event happens. The problem is; I don't know how to smoothly transition to the right fog value without creating a bunch of lines changing it one by one. So it ends up looking quick and ugly. Is there a way to do this without writing so many lines?

RemoteEvent.OnClientEvent:Connect(function(vamp)
    if vamp ~= localplayer then
        if localplayer.Character.charactervalues.Role.Value ~= "Vampire" then
            print("nightfaller")
            a.FogEnd = 25
            wait(0.1)
            a.FogEnd = 100
            wait(10)
            localplayer.PlayerGui.Nightfall.Sound:Play()
            localplayer.PlayerGui.Nightfall.Frame.Visible = true
            a.FogEnd = 25
            wait(83.5)
            a.FogEnd = 100
            localplayer.PlayerGui.Nightfall.Frame.Visible = false
            wait(5)
            localplayer.PlayerGui.Nightfall.Sound:Stop()
        end
        end

1 answer

Log in to vote
1
Answered by
Puppynniko 1059 Moderation Voter
2 years ago

Tween service once again!

0
Don’t ask how I got here quickly Puppynniko 1059 — 2y
0
Thanks. Uniplier 83 — 2y
Ad

Answer this question