This one is the local script under the blur in lightning
local blur = script.Parent
local frame = game.StarterGui.MenuGui.ScrollingFrame
frame.Visible = false
if frame.Visible == true then
blur.Size = 24
else
if frame.Visible == false then
blur.Size = 0
end
end
To add a blur effect when a menu is visible for someone or any cause for that matter, you must first understand that this change must be made on the client so that said change isn't made for all players at once. Looks like you have the concept down in your script, just a matter of accessing the instances the right way.
The line:
lua
local frame = game.StarterGui.MenuGui.ScrollingFrame
is wrong. game.StarterGui
contains the UI at its initial state and isn't the UI that the player sees or changes. The actual UI is copied from game.StarterGui
and put into the player's PlayerGui
. So, to fix your script you can use this:
```lua local blur = script.Parent local player = game:GetService("Players").LocalPlayer -- Returns the player instance of the client the script is running on (LOCALSCRIPTS ONLY) local frame = player.PlayerGui:WaitForChild("MenuGui", 10):WaitForChild("ScrollingFrame", 10) frame.Visible = false
-- Make the blur update when the frame changes frame:GetPropertyChangedSignal("Visible"):Connect(function() blur.Size = frame.Visible and 24 or 0 end end) ```
Please comment if you have any questions or I have made a mistake.