Unable to get Humanoid using a script

I feel pretty silly asking this because it’s so simple, but here we are. After spending hours of trying solutions I cannot get the player’s humanoid.

I’ve tried to in both server scripts and local scripts, but I keep running into the error of being unable to get the character too.

All localscripts in startercharacterscripts parent into the character.

-- StarterCharacterScripts

local Humanoid = script.Parent:WaitForChild("Humanoid")
-- ServerScript

game.Players.PlayerAdded:Connect(function(plr)
     plr.CharacterAdded:Connect(function(char)
       local Humanoid = char:WaitForChild("Humanoid")
   end)
end)
-- LocalScript not inside startercharacterscripts

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
2 Likes

Thanks, this works perfectly! Much appreciated

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.