everytime I run my script I get this in the output
It keeps saying the variables so character and player are nil values... and its really starting to piss me off because with every single variable I create it says the variable is nil and the entire reason why the script isn't working is because of it
edited script below
local player = game:GetService("Players").LocalPlayer
game.Players.LocalPlayer.CharacterAdded:connect(function(Char)
local character = game.Players.LocalPlayer.Character
repeat
wait()
until player.Character
character:WaitForChild("Torso")
character:WaitForChild("Head")
character:WaitForChild("Right Leg")
character:WaitForChild("Right Arm")
character:WaitForChild("Left Arm")
character:WaitForChild("Left Leg")
character:WaitForChild("Humanoid")
end)
character.Humanoid.Changed:connect(function(death)
if character.Humanoid.Health == 0 then
local i = game.Lighting.Death:Clone()
local o = game.Lighting.Death:Clone()
local p = game.Lighting.Death:Clone()
local a = game.Lighting.Death:Clone()
local s = game.Lighting.Death:Clone()
local d = game.Lighting.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")
d.Parent = character:FindFirstChild("Head")
-- 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
character:FindFirstChild("Head").Transparency = 1
character:FindFirstChild("Torso").Transparnecy= 1
-- Clothing Disappear
if character:FindFirstChild("Pants") then
character.Pants:Destroy()
if character:FindFirstChild("Shirt") then
character.Shirt:Destroy()
if character:FindFirstChild("Hat") then
character.Hat:Destroy()
if character:FindFirstChild("Hat") then
character.Hat:Destroy()
if character:FindFirstChild("Hat") then
character.Hat:Destroy()
end
end
end
end
end
end
end)

5 comments
As I have pointed out numerous times,
WaitForChild("Character")does NOT work because the Character is NOT a child of the Player.Thanks for the head's up. I just edited it so that it is more clear.
I would of appreciated if you would of atleast showed a script of how the beginning of mine should look to give me some idea on what you actually mean
Thank you for the example but sadly it doesn't work either....
Sorry, Sorry, I'm new here. I just put it in. Also, with your edited script, it is because character is local to the CharacterAdded function. You need to encase the entire code into the CharacterAdded function for it to work.