Why can't I get the character from the player?

Hey everyone, I am learning Roblox Lua and I wanted to know how could I get the Character for a Player. I tried the following code, but it does not work:

game.Players.PlayerAdded:Connect(function(player)
	player.Team = game.Teams.Team1
	player.Character.Humaoid.WalkSpeed = 100
end)

The error says “ServerScriptService.Script:3: attempt to index nil with ‘Humanoid’ - Server - Script:33”

Is there a way I could get the Character model into a variable or use right away?

Try doing

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
	player.Team = game.Teams.Team1
	character.Humanoid.WalkSpeed = 100
   end)
end)

you forgot the “n” here aswell

When the player gets added, the character isn’t fully loaded yet. Use the player.CharacterAppearanceLoaded event. Updated code:

game.Players.PlayerAdded:Connect(function(player)
	player.Team = game.Teams.Team1
    player.CharacterAppearanceLoaded:Connect(function(character)
        character.Humanoid.WalkSpeed = 100
    end)
end)

Edit after 2 minutes:
@9_Spy Using player.CharacterAppearanceLoaded is better practice, because you’re sure everything has loaded correctly and no errors will occur.

Yea, right after I posted the topic I saw the typo. The code worked, thanks!

I see, if the player.CharacterAppearanceLoaded is better, then I will try using it on my codes. Thanks!