Having problems with something

What i wanna achieve

so i want to make my gui when clicked the lightning blur size go to 10 but only guy who clicked see it so i Made RemoteEvent in replicatedstorage and added serverscript on serverscriptservice

This is the localscript in the ui that is for clicked

script.Parent.MouseButton1Down:Connect(function()

game.ReplicatedStorage.BlurEffect:FireServer(10) -- i made this to not make 2 remote events so the blur size will be here

print("Just did to 0")

end)

and in server-sided script for remote event what does

function onclicked(value)


game.Lighting.Blur.Size = value

print("made size to "..value)

end

game.ReplicatedStorage.BlurEffect.OnServerEvent:Connect(onclicked)

any help will be appreciated thanks!

1 Like

First of all, you don’t need a remote event for this. You just do it on the client. Since you want the blur to change for only the person who clicked the button, you would use a local script.

Just put this in your local script:

script.Parent.MouseButton1Down:Connect(function()
     game.Lighting.Blur.Size = 10
end)
1 Like

Try changing to

function onclicked(player,value)


game.Lighting.Blur.Size = value

print("made size to "..value)

end

game.ReplicatedStorage.BlurEffect.OnServerEvent:Connect(onclicked)

First of all, the code that you mentioned above will change the blur effect for the server (which means everyone in the game will have that changed). You do this in a local script if you want the blur to change for only one person.

@indexSource i think your code will run for server too because game.lightning.Blur is for server not in player idk how to explain what i mean
If it be like something like you said then we can use localscript to delete parts so others cant see

No. Everything you do in a local script only affects an individual player. Since we are setting the blur size in a local script, the blur will only change for one person. I recommend you learn a bit more about the differences between the client and the server and why remote events are used.

1 Like