Why's my tween funky?

the screen is red and is supposed to turn black. when you die it’s black, not turning black
code:

repeat wait() until game.Players.LocalPlayer.Character
repeat wait() until game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
local redscreen = script.Parent.Parent.RedScreen
local ts = game:GetService("TweenService")
local ti = TweenInfo.new(5,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out)
local tg = {}
redscreen.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
local tc = ts:Create(redscreen, ti, tg)
local humanoid = game.Players.LocalPlayer.Character.Humanoid
humanoid.Died:Connect(function()
	redscreen.Visible = true
	tc:Play()
	wait(5)
	redscreen.Visible = false
	script.Parent.Visible = true
	print("Death screen appeared")
end)

I dont get it, you’re using tg as the properties but it just a brackets with nothing side of it.

You have to set the Properties you want to change inside of the tg table.

repeat wait() until game.Players.LocalPlayer.Character
repeat wait() until game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
local redscreen = script.Parent.Parent.RedScreen
local ts = game:GetService("TweenService")
local ti = TweenInfo.new(5,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out)
local tg = {BackgroundColor3 = Color3.fromRGB(255, 0, 0)}
redscreen.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
local tc = ts:Create(redscreen, ti, tg)
local humanoid = game.Players.LocalPlayer.Character.Humanoid
humanoid.Died:Connect(function()
	redscreen.Visible = true
	tc:Play()
	wait(5)
	redscreen.Visible = false
	script.Parent.Visible = true
	print("Death screen appeared")
end)

also i recommend on doing this instead

repeat task.wait() until game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")

but also add variables to keep things short.

I made your script a little more understandable and better.

repeat
	task.wait()
until game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")

local redscreen = script.Parent.Parent.RedScreen
local ts = game:GetService("TweenService")
local ti = TweenInfo.new(
	5,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out
)

local tg = {BackgroundColor3 = Color3.fromRGB(255, 0, 0)}

redscreen.BackgroundColor3 = Color3.fromRGB(0, 0, 0)

local tc = ts:Create(redscreen, ti, tg)
local humanoid = game.Players.LocalPlayer.Character.Humanoid

humanoid.Died:Connect(function()
	redscreen.Visible = true
	tc:Play()
	
	task.wait(5)
	
	redscreen.Visible = false
	script.Parent.Visible = true
	
	print("Death screen appeared")
end)