local timer = 20
local lifetimer = 120 
local function Spring(player)
	if player.mo.skin ~= "leanbro" then // If the player's current skin is not Lean Bro
		return -- Abort the function
	end

	if (player.cmd.buttons & BT_CUSTOM1) then // If the player is pressing Custom 1
		if timer == 0 then
			player.spring = P_SpawnMobjFromMobj(player.mo, 0, 0, -5, MT_YELLOWSPRING) // Spawn Spring
			timer = 60
			player.spring.customAI = true
		end
	end
	if timer ~= 0 then
		timer = timer - 1
	end
end

addHook("PlayerThink", Spring)

addHook("MobjThinker", function(mo)
	if not mo.customAI -- If the customAI field is false or undefined
		return -- Abort the function
	end
	if lifetimer ~= 0 then
		lifetimer = lifetimer -1 
	end
	if mo.health > 0
	and lifetimer == 0
		P_KillMobj(mo) -- Remove the Spring
		lifetimer = 120
	end
end, MT_YELLOWSPRING)