Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How would I know when the character has loaded after death?

Asked by 4 years ago
local p = game.Players.LocalPlayer
wait(1.5)
local blr = Instance.new("BlurEffect", game.Lighting)
local TS = game:GetService("TweenService")
local inf = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0,false,0)
blr.Size = 0
local p = {
    Size = 24
}
local T1 = TS:Create(blr, inf, p)

game.Players.LocalPlayer.Character.Humanoid.Died:Connect(function()
    T1:Play()
end)

game.Players.LocalPlayer.CharacterAppearanceLoaded:Connect(function()
    print("ye")
end)

I am trying to make it print "ye" everytime the character has loaded after a death. But it doesn't work.

0
why don't you just use your variable "p" instead of typing out game.Players.LocalPlayer...? KDarren12 705 — 4y
0
Why use a CharacterAppearanceLoaded event instead of a CharacterAdded event? theking48989987 2147 — 4y

1 answer

Log in to vote
0
Answered by
EDLLT 146
4 years ago

Got you bud

local player = game.Players.LocalPlayer
repeat wait() until player.Character
local humanoid=game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
local blr = Instance.new("BlurEffect", game.Lighting)
local TS = game:GetService("TweenService")
local inf = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0,false,0)
blr.Size = 0
local p = {
    Size = 24
}
local T1 = TS:Create(blr, inf, p)

function died()
humanoid.Died:Connect(function()
       T1:Play()
end)

end

died()
game.Players.LocalPlayer.CharacterAdded:Connect(function()
    humanoid=game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
    blr.Size=0
    died()
end)
Ad

Answer this question