Hi!
This is my current shop code (and multiple other buttons, just with different locations.
How do I make it blur while it’s open?
Original Code
---{0.331, 0},{0.252, 0}
local ShopButton = script.Parent
local ShopFrame = script.Parent.Parent.Parent.Parent.MainShop
ShopFrame.Visible = false
ShopButton.MouseButton1Click:Connect(function()
if ShopFrame.Visible == false then
ShopFrame:TweenPosition(UDim2.new(0.331, 0, 0.252, 0), "Out", "Linear", .5, true)
ShopFrame.Visible = true
ShopButton.Text = "Close"
else
ShopFrame:TweenPosition(UDim2.new(1, 0, 0.252, 0), "Out", "Linear", .5, true)
wait(.5)
ShopFrame.Visible = false
ShopButton.Text = "Shop"
end
end)
Code I just changed with my understanding, not tested in any game
---{0.331, 0},{0.252, 0}
local ShopButton = script.Parent
local ShopFrame = script.Parent.Parent.Parent.Parent.MainShop
ShopFrame.Visible = false
ShopButton.MouseButton1Click:Connect(function()
if ShopFrame.Visible == false then
ShopFrame:TweenPosition(UDim2.new(0.331, 0, 0.252, 0), "Out", "Linear", .5, true)
ShopFrame.Visible = true
ShopButton.Text = "Close"
else
ShopFrame:TweenPosition(UDim2.new(1, 0, 0.252, 0), "Out", "Linear", .5, true)
wait(.5)
ShopFrame.Visible = false
ShopButton.Text = "Shop"
end
while ShopFrame.Visible == true do
wait()
--???
else
--????
end)
Thanks!
Just activate a blur locally that is premade in lighting, use the enabled future. Something like game.Lighting.Blur.Enabled = true/false
Instert a blur effect into the client who is in the shop
I dont want it to be for the full server.
Just add like
coroutine.wrap(function()
For i = 1, 20 do
--grow blur by 0.05
wait()
end
end)
1 Like
Thanks, but I want to know how to make it blur only the person’s screen. That helps tho!
Does the client know when the the shop opens?(client is the player) if so then do it on a local script so its for the player only.
If you activate a blur with a local script in staterGui it will be client sided.
I dont think you can do blurs in the UI?
---{0.331, 0},{0.252, 0}
local ShopButton = script.Parent
local ShopFrame = script.Parent.Parent.Parent.Parent.MainShop
ShopFrame.Visible = false
ShopButton.MouseButton1Click:Connect(function()
if ShopFrame.Visible == false then
ShopFrame:TweenPosition(UDim2.new(0.331, 0, 0.252, 0), "Out", "Linear", .5, true)
ShopFrame.Visible = true
ShopButton.Text = "Close"
game.Lighting.Blur.Enabled = true
else
ShopFrame:TweenPosition(UDim2.new(1, 0, 0.252, 0), "Out", "Linear", .5, true)
wait(.5)
ShopFrame.Visible = false
ShopButton.Text = "Shop"
game.Lighting.Blur.Enabled = false
end
end)
This should work with a local script in your UI.
pyxfluff
(Pyx)
May 29, 2021, 12:32am
#11
Is that only Local Sided? I know how to do that on the server, but this needs to be only local.
i’m trying to do something like this.
Yep it’s local.
Sorry for the background sounds.
1 Like
pyxfluff
(Pyx)
May 29, 2021, 12:34am
#13
Yes, but that’s enabling it for the whole server?
NotZylon
(shiesty)
May 29, 2021, 12:34am
#14
if it’s done on a local script it will effect one client, if done on server it will effect all
1 Like
A local script will control that.
So it will become client sided. AKA " local sided"
1 Like
The blur still stays client sided.
pyxfluff
(Pyx)
May 29, 2021, 12:42am
#17
This is dumb, but somehow it isn’t working.
---{0.331, 0},{0.252, 0}
local ShopButton = script.Parent
local ShopFrame = script.Parent.Parent.Parent.Parent.MainShop
ShopFrame.Visible = false
ShopButton.MouseButton1Click:Connect(function()
if ShopFrame.Visible == false then
ShopFrame:TweenPosition(UDim2.new(0.331, 0, 0.252, 0), "Out", "Linear", .5, true)
ShopFrame.Visible = true
ShopButton.Text = "Close"
coroutine.wrap(function()
for i = 1, 35 do
game.Lighting.UIBlur.Size += 1
wait(0.01)
end
end)
else
ShopFrame:TweenPosition(UDim2.new(1, 0, 0.252, 0), "Out", "Linear", .5, true)
wait(.5)
ShopFrame.Visible = false
ShopButton.Text = "Shop"
coroutine.wrap(function()
for i = 1, 35 do
game.Lighting.UIBlur.Size -= 1
wait(0.01)
end
end)
end
end)
That’s the full code, when I try to slowly increase it.
(sorry for how short it is, stupid roblox makes the file size REALLY small for 4k video, so not even a 7 second video would fit…)
2 Solutions
You forgot to put the Blur in lighting
The blur is disabled
Make sure to set the blur amount to 0
pyxfluff
(Pyx)
May 29, 2021, 12:45am
#19
I dont know why it isn’t working
Is this a local script in your UI?