[Solved] Does anyone know why Humanoid keeps on Indexing as "Nil"?

This is the code I’m trying, and HumanoidRootPart keeps on Indexing as Nil.
I’ve tried adding a wait to the code, and a function to wait for the character appearance and it still indexes as Nil. Is there any solutions to this problem? Please let me know!

Is it a server script or a local script? If it’s a localscript then you should get the character by doing Local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait() and after that clone it.

1 Like

It is a local script, and ill try both of those right now, then edit this to update you if they worked.

Both? The “or” is a part of the line. The code line ends when I say “and”. Sorry for the confusion :sweat_smile: So it’s actually “Local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()” but without the quotation marks.

All good for the confusion, but the game.Players.LocalPlayer.CharacterAdded:Wait() unfortunately does not work for some odd enough reason.

Do you know if there is an error inside the output. If there is any, what is it about?

If this is a localscript change local charclone to local charclone = game.Players.LocalPlayer.Character

There is no errors, I even added a print behind it to see if it would go through.
How ever the print did not fire, so im assuming its the character added.

Im trying to make a inventory type thing, where the players current avatar would clone into the VPF every once and a while.
What I have so far:
image

And the script is not disabled or anything? For me using CharacterAdded:Wait() works fine. But I haven’t tested it with changing auto respawn and stuff so I don’t know.

If you want to clone the character then you may have to do something with the “Archivable” property. I’ve tried cloning my own character before and it would just not clone the character at all.

Ill try it out again to see if it works, possibly is it the Local script location (Starter GUI).

That’s probably it, I just need to know how to archive the character and I assume it’d be well.

Ah ok, you could try

local charclone

game.Players.LocalPlayer.CharacterAdded:Connect(function()
       charclone = game.Players.LocalPlayer.Character
end)

Its because you can NOT clone a character, if you want to, set the character.Archivable to true and after cloning set it back to false to stop exploiters from breaking it in a way or another.

2 Likes

You could clone individual parts of the character if needed

Thank you so much, this works.
And I would like to also thank everyone for helping me as well with this!

Your welcome, i ran into this problem a while ago so i went in depth and learned alot! Glad i helped!