Sleep

script.Parent.ClickDetector.MouseClick:Connect(function(player)

game.ReplicatedStorage:WaitForChild("ScreenChange"):FireClient(player)

end)

local frame = script.Parent


frame.Visible = false


game.ReplicatedStorage:WaitForChild("ScreenChange").OnClientEvent:Connect(function()

frame.Visible = true

frame.YesButton.MouseButton1Click:Connect(function()

local color = game.Lighting:FindFirstChildWhichIsA('ColorCorrectionEffect')

if not color then

color = Instance.new('ColorCorrectionEffect')

color.Parent = game.Lighting

frame.Visible = false

local tweenInfo = TweenInfo.new(

5, -- Time

Enum.EasingStyle.Linear, -- EasingStyle

Enum.EasingDirection.InOut, -- EasingDirection

0, -- RepeatCount (when less than zero the tween will loop indefinitely)

true, -- Reverses (tween will reverse once reaching it's goal)

0 -- DelayTime

)

local tween = game:GetService("TweenService"):Create(color, tweenInfo, {Brightness = -1})

tween:Play()

tween.Completed:Wait()

color:Destroy()

end

end)

frame.NoButton.MouseButton1Click:Connect(function()

frame.Visible = false

end)

end)