When I try to get a player's Humanoid, I get the following error: "Attempt to index nil with Humanoid".
I tried multiple solutions, like for example adding WaitForChild() or FindFirstChild() functions, but I still get the folowing errors:
"Attempt to index nil with WaitForChild"
"Attempt to index nil with FindFirstChild"
Everything works well if I place my script under StarterCharacterScripts, but in my case I absolutely need to place my script under StarterPack. Please help, I don't understand why I get this error!
In other words:
The following line of the script breaks if the script is placed under StarterPlayerScripts, StarterGui or StarterPack:
local Humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
But it works perfectly if under StarterCharacterScripts.
I tried multiple solutions, like for example adding WaitForChild() or FindFirstChild() functions, but I still get the folowing errors:
"Attempt to index nil with WaitForChild"
"Attempt to index nil with FindFirstChild"
Everything works well if I place my script under StarterCharacterScripts, but in my case I absolutely need to place my script under StarterPack. Please help, I don't understand why I get this error!
In other words:
The following line of the script breaks if the script is placed under StarterPlayerScripts, StarterGui or StarterPack:
local Humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
But it works perfectly if under StarterCharacterScripts.