so baasically im trying to change the character with a click detector

local click = script.Parent.ClickDetector
local rig = game.ServerStorage.StarterCharacter

click.MouseClick:Connect(function(player)
	player.Character = rig
	rig.Name = player.Name

end)

when i click it the player in workspace disappear, how do i fix it?