#Gui Blur

1 messages · Page 1 of 1 (latest)

glass maple
#

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local Lighting = game:GetService("Lighting")

local player = Players.LocalPlayer

local mainFrame = script.Parent
local redFrame = mainFrame.RedFrame
local blueFrame = mainFrame.BlueFrame
local redButton = redFrame.RedButton
local blueButton = blueFrame.BlueButton

local chooseTeamEvent = ReplicatedStorage:WaitForChild("ChooseTeam")
local blur = Lighting:FindFirstChild("TeamBlur")

local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out)
local fadeInfo = TweenInfo.new(0.3, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)

local function animateAndHide(selectedFrame)
if blur then
local blurTween = TweenService:Create(blur, TweenInfo.new(0.3), { Size = 20 })
blurTween:Play()
end

local originalPos = selectedFrame.Position
local upTween = TweenService:Create(selectedFrame, tweenInfo, {
    Position = originalPos - UDim2.new(0, 0, 0.1, 0)
})
upTween:Play()

task.wait(0.4)
local redDown = TweenService:Create(redFrame, fadeInfo, {
    Position = redFrame.Position + UDim2.new(0, 0, 1, 0),
    BackgroundTransparency = 1
})
local blueDown = TweenService:Create(blueFrame, fadeInfo, {
    Position = blueFrame.Position + UDim2.new(0, 0, 1, 0),
    BackgroundTransparency = 1
})
redDown:Play()
blueDown:Play()

end

redButton.MouseButton1Click:Connect(function()
chooseTeamEvent:FireServer("Red")
animateAndHide(redFrame)
end)

blueButton.MouseButton1Click:Connect(function()
chooseTeamEvent:FireServer("Blue")
animateAndHide(blueFrame)
end)

#

Basically the problem is that whenever I click one of my buttons (RedButton And BlueButton) the tweening and the animation for that works. But the only problem is that I have a blur called TeamBlur inside of lighting and for some reason it only appears after i click one of the two image buttons

glass maple
tidal stirrup
#

can u show a picture

#

of the gui blur

glass maple
#

yea i got you

#

the second one is like after the gui goes away

#

@tidal stirrup

tough pine
glass maple
#

what should i change it to @tough pine ?

modest drumBOT
#

studio** You are now Level 8! **studio

tough pine
#

Use the depth of fiel and change it to enabled, then make the min distance 0 if not min then max then use the script to enable or disable it.

#

Not sure what it is you want the script to do (I can't actually read scripts from others well.) So I'd just use a textbutton and then do a MouseButton1Down connect to Function then do Game.Lighting.DepthOfField.Enabled = False

glass maple
#

never mind all fixed now thanks @tough pine