My death script usual works as intended sometimes the fade at the end (CC) would fade in but not out, the chances of this were low until my player died to a damage brick, now the fade usually wont fade out, only by a reset death will it most of the work as intended.
Anyone know the problem??
the code where im sure the problem is, this is where the tint color fades in and out.
local TS = game:GetService("TweenService")
local RespawnE = game.ReplicatedStorage.Respawn
local backG = script.Parent
local mainF = script.Parent.MainFrame
local sideF1 = script.Parent.SideFrame1
local sideF2 = script.Parent.SideFrame2
local title = script.Parent.MainFrame.Title
local message = script.Parent.Message
local blur = game.Lighting.DeathBlur
local colour = game.Lighting.DeathColour
local deathS = game.SoundService.DeathSound
local plr = game.Players.LocalPlayer
local char = plr.Character
local hum = char:WaitForChild("Humanoid")
local titleVariants = {
"Perished",
"Fallen",
"Ded",
"Dead",
"Departed",
"Passed",
"Lost",
"Gone",
"Broken",
"Lifeless",
"Unalive",
"Asleep",
"Erased",
"Wasted",
"Inanimate",
"Oofed",
"Duhed",
"Lost",
"Soulless"
}
local messageVariants = {
"Dont give up.",
"Your not done yet.",
"Stay determined",
"Not now.",
"Not yet.",
"You've got a job to do.",
"Yours times not done.",
"This isn't it.",
"You've got alot of work to do.",
"Get back up.",
"Too early.",
"Winners never quit.",
"Quitters never win.",
"Theres so much left.",
"Rise.",
"Cant sleep just yet.",
"What are you doing here?",
"This isnt fruitfull yet."
}
mainF.Size = UDim2.new(0, 0,0, 104)
sideF1.Size = UDim2.new(0, 0,0, 19)
sideF2.Size = UDim2.new(0, 0,0, 19)
mainF.Transparency = 1
sideF1.Transparency = 1
sideF2.Transparency = 1
title.TextTransparency = 1
message.TextTransparency = 1
hum.Died:Connect(function()
deathS:Play()
backG.Visible = true
local randomTitle = titleVariants[math.random(1, #titleVariants)]
title.Text = randomTitle
local randomMessage =messageVariants[math.random(1, #messageVariants)]
message.Text = randomMessage
local mainFAnim = mainF:TweenSizeAndPosition(UDim2.new(0, 1000,0, 104), UDim2.new(0.499, 0,0.498, 0))
TS:Create(blur, TweenInfo.new(1), {Size = 24}):Play()
TS:Create(colour, TweenInfo.new(1), {TintColor = Color3.fromRGB(102, 48, 48), Saturation = -1}):Play()
TS:Create(mainF, TweenInfo.new(1), {BackgroundTransparency = 0.5}):Play()
TS:Create(title, TweenInfo.new(1), {TextTransparency = 0}):Play()
wait(0.25)
local sideF1Anim = sideF1:TweenSizeAndPosition(UDim2.new(0, 1000,0, 19), UDim2.new(0.499, 0,0.383, 0))
local sideF2Anim = sideF2:TweenSizeAndPosition(UDim2.new(0, 1000,0, 19), UDim2.new(0.499, 0,0.615, 0))
TS:Create(sideF1, TweenInfo.new(1), {BackgroundTransparency = 0.5}):Play()
TS:Create(sideF2, TweenInfo.new(1), {BackgroundTransparency = 0.5}):Play()
TS:Create(message, TweenInfo.new(2), {TextTransparency = 0}):Play()
wait(4)
TS:Create(colour, TweenInfo.new(1), {TintColor = Color3.fromRGB(0, 0, 0), Saturation = 0}):Play()
TS:Create(mainF, TweenInfo.new(1), {BackgroundTransparency = 1}):Play()
TS:Create(title, TweenInfo.new(1), {TextTransparency = 1}):Play()
TS:Create(sideF1, TweenInfo.new(1), {BackgroundTransparency = 1}):Play()
TS:Create(sideF2, TweenInfo.new(1), {BackgroundTransparency = 1}):Play()
TS:Create(message, TweenInfo.new(1), {TextTransparency = 1}):Play()
wait(0.72)
RespawnE:FireServer()
blur.Size = 0
TS:Create(colour, TweenInfo.new(2), {TintColor = Color3.fromRGB(255, 255, 255), Saturation = 0}):Play()
backG.Visible = false
I think it might have something to do with the 'wait()'s there is or something at the end.

