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

These two simple codes don't work?

Asked by 6 years ago

So... analyze these two simple scripts here:

lighting = game:GetService("Lighting")
lighting.Blur.Size = 24 -- blur actually changes


lighting = game:GetService("Lighting")
blursize = lighting.Blur.Size

blursize = 24 -- blur does not change

Any idea why the former one works but the latter one doesn't? Thanks.

1
The second code sets to what the value's number is, while the first is set up for the blur object itself. TheeDeathCaster 2368 — 6y
0
@TheeDeathCaster How did you know :O? greatneil80 2647 — 6y
0
@TheeDeathCaster can you clarify that a little bit? I am struggling to understand TokyoBuilder 5 — 6y
0
So when you say: lighting.Blur.Size = 24, you are setting it's value; as opposed to when you say blurSize = lighting.Blur.Size, you are not making a shortcut to the blur's size, rather, your blurSize is just the number 24. Garfanzo 30 — 6y
View all comments (2 more)
0
It's like saying `local y = 7 .... y = 28 <--Rewrites the variable` for the second code, while the first one changes the value itself instead of rewriting the variable. Think of the second code similar to this: http://wiki.roblox.com/index.php?title=Variable#Swapping TheeDeathCaster 2368 — 6y
0
I see. Thanks guys! TokyoBuilder 5 — 6y

1 answer

Log in to vote
-1
Answered by 6 years ago

try putting a local script into lighting and put local before

ex

local lighting = game:GetService('Lighting') local blur = lighting.blur.size OR

local blur = game.lighting.blur.size blur = 24

OR just change properties

if you cant do the script in lighting i guess you have to deal with it i ran into this problem as well

Ad

Answer this question