Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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.

2 comments

0

why don't you just use your variable "p" instead of typing out game.Players.LocalPlayer...?

0

Why use a CharacterAppearanceLoaded event instead of a CharacterAdded event?

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.