For some reason it keeps erroring out and giving me this message
Players.YouShalllNotPass.Backpack.FuncDeath:5 : Attempt to index field 'Character' (a nil Value)
IT IS A LOCALSCRIPT
here's my script :
local character = game.Players.LocalPlayer.Character
local player = game.Players.LocalPlayer
local char = game.Players.LocalPlayer.Character
game.Players.LocalPlayer.Character.Humanoid.Changed:connect(function(death)
if game.Players.LocalPlayer.Character.Humanoid.Health == 0 then
local i = game.ServerStorage.Death:Clone()
local o = game.ServerStorage.Death:Clone()
local p = game.ServerStorage.Death:Clone()
local a = game.ServerStorage.Death:Clone()
local s = game.ServerStorage.Death:Clone()
local d = game.ServerStorage.Death:Clone()
i.Parent = character.Torso
o.Parent = character:findFirstChild("Right Arm")
p.Parent = character:findFirstChild("Right Leg")
a.Parent = character:FindFirstChild("Left Arm")
s.Parent = character:FindFirstChild("Left Leg")
-- Limbs Disappear
character:findFirstChild("Right Arm").Transparency = 1
character:findFirstChild("Right Leg").Transparency = 1
character:FindFirstChild("Left Arm").Transparency = 1
character:FindFirstChild("Left Leg").Transparency = 1
-- Clothing Disappear
if char:FindFirstChild("Pants") then
char.Pants:Destroy()
if char:FindFirstChild("Shirt") then
char.Shirt:Destroy()
if char:FindFirstChild("Hat") then
char.Hat:Destroy()
if char:FindFirstChild("Hat") then
char.Hat:Destroy()
if char:FindFirstChild("Hat") then
char.Hat:Destroy()
end
end
end
end
end
end
end)

2 comments
local
LocalScripts often run before the Character spawns. On line 5 you're assuming that the character exists and has a humanoid. I edited the answer to include how to fix this.