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)
KultDeeri
(Kult)
#2
I dont get it, you’re using tg as the properties but it just a brackets with nothing side of it.
The_IntoDev
(The_IntoDev)
#3
You have to set the Properties you want to change inside of the tg table.
CZXPEK
(czo)
#4
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)
KultDeeri
(Kult)
#5
also i recommend on doing this instead
repeat task.wait() until game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
KultDeeri
(Kult)
#7
but also add variables to keep things short.
The_IntoDev
(The_IntoDev)
#8
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)