BoolValue Not Changeing

Hello, i have been making a on/off button, but for some reason it doesn’t work.
When i click it didn’t change the text or value.
local Player = game.Players.LocalPlayer

    local Blur = Player:WaitForChild("DataSafe2"):WaitForChild("BlurSettings")
    local On = game.ReplicatedStorage.SettingsEVent.BlurOn
    local Off = game.ReplicatedStorage.SettingsEVent.BlurOff


    script.Parent.MouseButton1Click:Connect(function()
    	if Blur.Value == true then
    		Off:FireServer()----fasle
    			script.Parent.Text = "Disabled"
                else
    		if Blur.Value == false then
    			On:FireServer()---true
    				script.Parent.Text = "Enabled"
    		end
    	end
    end)


    if Blur.Value == false then
    	script.Parent.Text = "Disabled"
    end


    if Blur.Value == true then
    	script.Parent.Text = "Enabled"

end

For the blur, you can change a blur effect for just one client, so putting

game.Lighting.Blur.Enabled = not game.Lighting.Blur.Enabled

should toggle the blur on or off. Then you just need to detect if the blur is on and change the text accordingly.

Right now, you aren’t changing the value of “Blur”, so it will just do this part every time

I forgot to say but i have as boolvalue because Datastore2

i have the remoteevent to call for datastore2 to change the BoolValue

Do you want to save the setting? Is that why you want to change a bool value?

yes. (30Charsssssssssssssssssssss)

Assuming you have the bool value inside the player or in a folder inside the player, you can just change it from a local script on the client side.

Edit: You can just say

local bool = -- Bool value
game.Lighting.Blur.Enabled = not game.Lighting.Blur.Enabled 
if game.Lighting.Blur.Enabled then -- Detecting if it is enabled
    script.Parent.Text = "Enabled"
    bool.Value = true
else
    script.Parent.Text = "Disabled"
    bool.Value = false
end

I think i found the problem i made a if statement in ServerScriptService

local Player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
    local Blur = Player:WaitForChild("DataSafe2"):WaitForChild("BlurSettings")
    if Blur.Value == true then
    print("True")
    end
    if Blur.Value == false then
    print("false")

    end  

It Print False When Value was True