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

Tinker With Blur by using a script?

Asked by
clrik 8
6 years ago

How can like, when I touch a part, the blur rises then decreases.

Blur = Instance.New("BlurEffect")

Help?

1 answer

Log in to vote
0
Answered by 6 years ago

You could use tweenservice but it would be better if you use repeat

local Part = script.Parent -- put the script under a parent
local Blur = game:GetService('Lighting'):WaitForChild('BlurEffect') -- So put the blur inside lighting

Debounce = true

function Fade()
    repeat
        wait(0.01)
        Blur.Size = Blur.Size + 0.1
    until Blur.Size >= 50

    wait(2)

    repeat
        wait(0.01)
        Blur.Size = Blur.Size - 0.1
    until Blur.Size <= 0
end

Part.Touched:connect(function(hit)
    if Debounce then
        Debounce = false

        if hit.Parent:FindFirstChild('Humanoid') then
            Fade()
        end

        Debounce = true
    end
end)

If you have any questions about this script please ask me, if you want it so the blur is client only you should connect it to an event, good luck!

0
Wait...where does the script go? clrik 8 — 6y
0
Inside the part where you want it to blur (part needs to be inside workspace), don't forget to add a Blur inside Lighting called BlurEffect! User#20388 0 — 6y
0
Thank you! I've learned how to make it faster, and everything!! Now this will be good for my game :3 clrik 8 — 6y
0
Np :) User#20388 0 — 6y
0
:P clrik 8 — 6y
Ad

Answer this question