Why wont my color correction change?

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.


this is most of the code, and where the tint (CC) changes are.

1 Like

I can’t tell the error here, the TintColor seems to change. Maybe just paste the same tween as the dead transition (also please just make a comment where the the TintColor is, it’s hard to read out of that).

okay so at line 90 is the tint changing to the redish background (which works fine)
line 107 is where the tint fades into black (works fine)
line 119 is where its supposed to fade out but it doesnt

however when i decrease the wait at line 115 it works but i need it at 0.75 for a smooth transition from dead to alive

also i tried placing the fade out tween in different areas and multiple at once and it doesnt work sadly

maybe use a task.wait(0.75)? char limit

tried that too, didnt work
i tried doing wait(0.72) and it works, still smooth transition aswell. I dont know the logic behind it but if i do 0.73 or higher it doesnt work sooo solution? but i want to know WHY :confused:

might sound ridiculous now but how about you the wait(0.72) and then add another wait wait(0.03)?

lol i could but NOW it started to bug out again so being at 0.72 helps reduce the risk not get rid of it tho :expressionless:

tuff times man

okay i was just trying to cut out the unessecary parts but here the full script

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
	
end)

image

Thanks for helping but it still creates the same problem

Well i did check my progress and double tested your script and it still creates the same problem also i gave you every detail you would need i cant think of anything else. Ik i could just try a different way of scripting it but i want to know why it does that instead of avoiding it

wdym i wasnt testing as i go? If your talking about a topic thats not about “why wont my CC change” idk why your going off topic, either way i am testing as i go now. Im just looking a solution (answer along with explanation) to this problem but if you cant help dont bother and if you can then just tell me whats wrong with it if you really dont want to give a solution

My script was a guess … you got me guessing and programmers don’t guess.
I need everything you got to work with and I’m not creating it.
(that again would be guessing)

as this is a local script, you could try

local Players = game:GetService("Players")
local player = Players.LocalPlayer

local function onCharacterAdded(character)
-- gui reset function here
end

player.CharacterAdded:Connect(onCharacterAdded)

assuming its put in StarterPlayerScripts

I found a “solution” in the end i just made it wait(0.7) and it works, i dont know the logic behind it but i think this is the best i could get it for now either way it still works as i want.
Maybe one day i would know why it cant be wait(0.75) but can be wait(0.7)

I tried your way but nothing showed up (probably because i did something work), thanks for helping anyway!

This is great, something didn’t have time to load. Good job!