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

Script editing the Size of a Blur in the Lighting does not work?

Asked by 4 years ago

This script is pretty simple and I don't see any inherent issues with it, so I imagine theres some rule of Roblox Studio i'm missing here? This is a server script in the workspace attempting to edit the size of a Blur Effect in the Lighting.

local blur = game.Lighting.Blur.Size
while true do
    wait(3)
    blur = 2
    wait(0.1)
    blur = 4
    wait(0.1)
    blur = 6
    wait(0.1)
    blur = 8
    wait(0.1)
    blur = 10
    wait(0.1)
    blur = 12
    wait(0.1)
    blur = 14
    wait(0.1)
    blur = 16
    wait(0.1)
    blur = 18
    wait(0.1)
    blur = 20
    wait(0.1)
    blur = 22
    wait(0.1)
    blur = 24
    wait(0.1)
    blur = 22
    wait(0.1)
    blur = 20
    wait(0.1)
    blur = 18
    wait(0.1)
    blur = 16
    wait(0.1)
    blur = 14
    wait(0.1)
    blur = 12
    wait(0.1)
    blur = 10
    wait(0.1)
    blur =8
    wait(0.1)
    blur = 6
    wait(0.1)
    blur = 4
    wait(0.1)
    blur = 1
    wait(0.1)
end

It does not work at all.

1 answer

Log in to vote
0
Answered by
JakyeRU 637 Moderation Voter
4 years ago

Hello, You have to define the Blur, not it's property Size. I recommend you to use TweenService to do that.

Here's an example:

local Blur = game.Lighting:WaitForChild("Blur")
local TweenService = game:GetService("TweenService")
local TweenInformation = TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)

while true do
    TweenService:Create(Blur, TweenInformation, {Size = 30}):Play()
    wait(2)
    TweenService:Create(Blur, TweenInformation, {Size = 1}):Play()
    wait(2)
end

Please read this: https://developer.roblox.com/api-reference/class/TweenService

There you will find everything about TweenService, including its syntax.

0
Thanks, my scripting skills are outdated so I guess I have some research to do. Octocentillion 15 — 4y
Ad

Answer this question