So i would like to have Blur on/off button in my experience, but I’m struggling in scripting it. I’m pretty sure It is easy script, i just can’t get it together. (Also stupid me deleted the script, i wanted to try something and forgot to copy.)
local button = script.Parent -- Replace with your button's directory
local blur = game.Lighting:WaitForChild("Blur") -- Make sure to have a blur object in Lighting
button.Activated:Connect(function()
blur.Enabled = not blur.Enabled
end)
This script should work for mobile and PC users and just switches the Enabled property on the blur to the opposite of the current boolean.
Just another question, Is there any possibility that you could add the part of script when you click the button the text changes from “Blur Off” to “Blur on”?
local button = script.Parent -- Replace with your button's directory
local blur = game.Lighting:WaitForChild("Blur") -- Make sure to have a blur object in Lighting
button.Activated:Connect(function()
blur.Enabled = not blur.Enabled
if blur.Enabled then
button.Text = "Blur on"
else
button.Text = "Blur off"
end
end)
Wasn’t sure if you wanted the button to state what the blur’s current state was or what it would be after you pressed the button. I just scripted it so it shows the current state, if you want it to show the state after you pressed it just swap around the text.
EDIT: When you first launch the game it will be the text already there. Just manually edit the text in studio to what you want.
One last thing, I’m trying to make the button appear after the game intro is done playing, and I already have one working button, and that appears after the intro, so i tried taking the script which was used, and changing it to proper naming but now it somehow doesnt work?
It would make me really happy if you could take a look.
Original Additional lanes of script that was implemented into the intro script (Working one):
local player = game.Players.LocalPlayer
local SoundGui = player:WaitForChild("PlayerGui"):WaitForChild("SoundGui")
SoundGui.Enabled = true
The Updated one (Not working):
local player = game.Players.LocalPlayer
local BlurGui = player:WaitForChild("PlayerGui"):WaitForChild("BlurGui")
BlurGui.Enabled = true
Could you open the output window so I can see if an error comes up when you play test your game? Go to view then click on output to open it. Send a screenshot of the entire output window please as this would really help because I am stumped to why it would do this.
Are you hiding the blur GUI at the start of the script, as I think you are hiding the music GUI at the start looking at the other post. You are putting the .Enabled = true lines of code at the end of your tweens so I believe they are going to appear at the very end.
If this doesn’t work, I think you should create a new post about this problem so others could help you too. I’ve got no idea what is causing this problem but if I find a possible solution I will let you know in the new post.
Wait, I’m SO STUPID. I just rode the whole topic again, (The one with Music Button) and realized I’ve never actually putted Visibility false at the start of the intro script.