local tweenService = game:GetService("TweenService")
local background = --the background of the deathgui
local tweenInfo = TweenInfo.new(4, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
local tweenGoal = {BackgroundTransparency = 0}
local humanoid = game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
local tween = tweenService:Create(background, tweenInfo, tweenGoal)
humanoid.Died:Connect(function()
tween:Play()
end)
Sorry. My previous post won’t work. Instead, do something like this. Create a RemoteEvent called OnDeath and paste it in ReplicatedStorage. Then, do this:
Add a LocalScript in StarterGui and write this inside:
local tweenService = game:GetService("TweenService")
local background = --the background of the deathgui
local tweenInfo = TweenInfo.new(4, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
local tweenGoal = {BackgroundTransparency = 0}
local tween = tweenService:Create(background, tweenInfo, tweenGoal)
game.ReplicatedStorage.OnDeath.OnClientEvent:Connect(function()
tween:Play()
end)