How can i make sure this part of a script works?

So im trying to check if the model name is “Stonks Head” But it’s not working, the script is changing the players character to a head when i want the head to be on the player’s character’s head

	print("Destroyed")
	player.Character = CharacterClone
		print("Nearly")		
	local root = CharacterClone:WaitForChild("HumanoidRootPart")
	local hum = CharacterClone:FindFirstChild("Humanoid")
	wait()
	root.CFrame = cframe
	CharacterClone.Parent = game.Workspace
		elseif itemname == "Stonks Head" then
			local newStonks = item:Clone()
			newStonks.Parent = player.Character.Head
			player.Character.Head.Transparency = 1

Your first mistake is your elseif, you need an if statement in order to make elseif work.
You have no if statements in your code.

Elseif will not work if there is no if statement to initialise the actual argument.

like this?

print(CharacterClone.Name)
	local cframe= player.Character.HumanoidRootPart.CFrame
	player.Character:Destroy()
	print("Destroyed")
	player.Character = CharacterClone
		print("Nearly")		
	local root = CharacterClone:WaitForChild("HumanoidRootPart")
	local hum = CharacterClone:FindFirstChild("Humanoid")
	wait()
	root.CFrame = cframe
	CharacterClone.Parent = game.Workspace
		if itemname == "Stonks Head" then
			local newStonks = item:Clone()
			newStonks.Parent = player.Character.Head
			player.Character.Head.Transparency = 1

Now you’re missing an end, an if statement needs an end, otherwise it’ll error.

i added that but the script still carries on, it does everything on the top and then does the if statement on the bottom