[HELP] How can I fix this script

Kaiden’s script doesn’t account for the fact that the player’s chatacter is removed before PlayerRemoving is fired.

1 Like

Ok I tested the script and it doesnt save my head size, whenever I rejoin, it resets my head to its original size

I duplicated the line here (local character) from the other part of the script, did I do it right?

game.Players.PlayerRemoving:Connect(function(player)
	
	local character = player.Character or player.CharacterRemoving:Wait()
	
	local success, errormessage = pcall(function()
		mdss:SetAsync(player.UserId.."-Head",player.Character.Humanoid.HeadScale.Value)
	end)

As i said, by the time that PlayerRemoving fires the character already doesn’t exist anymore. You will need to attach a CharacterRemoving event when the player joins but since that event also fires when they die you will need to check whether or not their chatacter is removed because they are leaving or because they died