Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I make a smooth transition of a property with less lines of code?

So I want to make a smooth transition with the Blur effect, and sure I could do something like this:

local Blur = game.Lighting.Blur

script.Parent.MouseButton1Click:Connect(function()

Blur.Size = 1
wait(.1)
Blur.Size = 2
wait(.1)
Blur.Size = 3
wait(.1)
Blur.Size = 4
wait(.1)
Blur.Size = 5
wait(.1)

--etc, etc..

But that can be a bit repetitive and messy, so I was wondering if anyone knows a way to make it do that, but with less lines of code. Thanks for the help in advance.

1 comment

0

Do you want this to go on forever? Or do you want it to stop when something happens? Please specify

1 answer

✓ Accepted answer

Hi! This is a simple one. You can use a loop to do this.

local Blur = game.Lighting.Blur

function blur()
Blur.Size = Blue.Size + 1
end

script.Parent.MouseButton1Click:Connect(function()
while Blur.Size < 10 then
blur()
end)

Untested, but should work.

~~SpiralRBX

2 comments

0

yay thanks, jut needed to add a wait, and change then to do.

0

<3

This discussion is preserved as it was. New answers, comments, and votes are closed.