Question about local script

So yesterday i wanted to make ui effect when you click on it blur effect in lightning gets Size 10 and guy told be that i can use only local script to do it by simply doing game.lightning.blur.size = 10 my question is will it make only visible for the player who clicker or whole server i cant do 2 plr test mode my pc crashes everytime i do

2 Likes

If you create a blur effect using a localscript which then parents it to lighting then only that player will see it.

local blur = Instance.new("BlurEffect")
blur.Size = 10
blur.Parent = game:GetService("Lighting")
1 Like

No i have thw blur effect in already lightning Having problems with something

1 Like

The problem is since the blur effect was made on the server (or in studio) all players will see it. You want to create it on the client using a LocalScript.

script.Parent.MouseButton1Down:Connect(function()
	local blur = Instance.new("BlurEffect")
	blur.Size = 10
	blur.Parent = game:GetService("Lighting")
	print("Created blur")
end)

If you want to set the size of the blur at a later time simply create the blur effect when the player loads in, you can do this by having a LocalScript in StarterPlayerScripts that simply creates a blur effect.

local blur = Instance.new("BlurEffect")
blur.Size = 0
blur.Parent = game:GetService("Lighting")

And then to update it at a later time:

script.Parent.MouseButton1Down:Connect(function()
	local blur = game:GetService("Lighting"):FindFirstChildWhichIsA("BlurEffect")
	blur.Size = 10
end)

To make a LocalScript effect the entire server you need to use Remote Functions/Events, aswell as learn about Filtering Enabled.

It says referring the lighting, so it will replicate to the whole server. But if it’s referring the camera, only that client will see the blur effect.

If you want to do for the player who clicked the button, it is simple, use a localscript to change a Blur’s size inside of lighting service, the reason it won’t replicate to the whole server is because any changes made by the Client aren’t replicated to the server, so the server will still see the same thing as before.

This applies to every localscript that you create, if it makes any changes it replicates only for that specific client.

1 Like