Hello there
Wrote a script that makes screen full dark and change some colorcorrection settings after dying, then reset it all after character spawn in. The problem is, gui doesn’t work as needed after first death.
I already know the option called “ResetOnSpawn” causing it but i dont really know how to fix this, as usual.
Script location:
Code:
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
local TS = game:GetService("TweenService")
local curcc = game.Lighting.cc -- this is current colorcorrection instance, deadcc is like a preset for it
local deadcc = game.Lighting.ColorCorrections.Dead
local duration = 1
Humanoid.Died:Connect(function()
TS:Create(curcc,TweenInfo.new(.5),{
Brightness=deadcc.Brightness,
Contrast=deadcc.Contrast,
Saturation=deadcc.Saturation,
TintColor=deadcc.TintColor
}):Play()
task.wait(2)
TS:Create(script.Parent, TweenInfo.new(duration/2),{BackgroundTransparency=0}):Play()
task.wait(game.Players.RespawnTime-2)
curcc.Brightness = 0
curcc.Contrast = 0
curcc.Saturation = 0
TS:Create(script.Parent, TweenInfo.new(duration),{BackgroundTransparency=1}):Play()
end)
Hope for yall brains