When the Humanoid dies, the GUI should be visible; It’s not working though.
The code:
local plrs = game:GetService("Players")
local DeathT = script.Parent:WaitForChild("Death")
local plr = plrs.LocalPlayer or plrs.PlayerAdded:Wait()
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(3)
local tween = TweenService:Create(DeathT,tweenInfo,{["BackgroundTransparency"] = 0, ["TextTransparency"] = 0})
local tween2 = TweenService:Create(DeathT,tweenInfo,{["BackgroundTransparency"] = 1, ["TextTransparency"] = 1})
plr.CharacterAdded:Connect(function(chr)
local hum = chr:WaitForChild("Humanoid")
hum.Died:Connect(function()
tween:Play()
DeathT.Text = plr.Name .. " has died."
task.wait(4)
tween2:Play()
end)
end)
Any help is hugely appreciated because I’m really bad at coding.