Need help getting Humanoid

Hi there I am a bit rusty when it comes to lua but I need some help getting the humanoid of a single player. And the game can only have one player so i dont need fancy stuff to get the name

game.Players.PlayerAdded:Connect(function(thisPlayer)
	local playerName = thisPlayer.Name
	print(playerName)
end)

See this is what i have currently. It prints the name but it doesnt do much else
How would i go about getting the humanoid from “playername” ?

It’s pretty simple, using the PlayerAdded function you used you can do something like CharacterAdded just below it.

It would look something like this.

game.Players.PlayerAdded:Connect(function(thisPlayer)
	thisPlayer.CharacterAdded:Connect(function(Character) -- we use the player to call the built in CharacterAdded function
		local Humanoid = Character:WaitForChild("Humanoid") -- there you go you have the humanoid of the player

		local playerName = thisPlayer.Name
		print(playerName)
	end)
end)

Thanks dude I couldnt figure it out myself cause i stopped developing for like a year.

1 Like

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