So I am trying to make a 2d platformer where the character can change colour by pressing certain keys. I am currently trying to figure out how to find the character as game.Players.LocalPlayer.Character says it's a nil value. I then went to the Dev Hub and found the character page. I changed to a local script and changed to player.Character and still no luck as player is unknown. Here is a small part of the code I am working with:
if player.Character.Head.BrickColor == BrickColor.new("Really red") then
script.Parent.BrickColor = BrickColor.new("Really red")
end
I also have the code in a LocalScript inside of a Part in workspace. Any sort of help would be appreciated!

2 comments
game.Players.LocalPlayer.Character is a nil value because you have to do game.Players.LocalPlayer:WaitForChild("Character")
@cucucu0001 Bro, no. All LocalScripts are loaded after a player is loaded, there's no need to wait for the Character to load