Hat team script

this script will not work. keep getting error
ServerScriptService.Script:10: attempt to index nil with ‘Name’

local  ss = game:GetService("ServerStorage")
print("Test")

local function playerAdded(player)
	print("Test")
	player.CharacterAdded:Connect(function(char)
		print("Test")
		local Nose = nil
		print("Test")
		if player.Team.Name == ("White") then
			print("Test")
			Nose = ss:WaitForChild("Nose"):Clone()
			print("Test")
		end
		local hum = char:WaitForChild("Humanoid") 
		print("Test")
		hum:AddAccessory(Nose)
		print("Test")
		end)
end
print("Test")
game.Players.PlayerAdded:Connect(playerAdded)
print("Test")

I recommend not mass spam printing “test” and instead printing the line it’s on as it will allow you to understand where a logic error may happen (in the future)

To fix your issue do this instead.

LINE 3

local teams = game:GetService("Teams")

EVERYWHERE UR CHECKING FOR TEAM NAME

if player.Team == teams["Argument"]

https://developer.roblox.com/en-us/api-reference/property/Player/Team