This Script put a local script into the players character when the character is added but I need the local script to work when the player resets also.
Script
player.CharacterAdded:connect(function(Character) script.LocalScript:clone().Parent = Character end)
The issue is the way your trying to get it, player is nil in this script, also, we need to change the way you get the players character. To fix that we can do this:
game:GetService("Players").PlayerAdded:connect(function(p) p.CharacterAdded:connect(function() script.LocalScript:clone().Parent = p.Character end) end)