if IsPlayer(EntityGetParent(GetUpdatedEntityID())) == true or
EntityGetName(EntityGetParent(GetUpdatedEntityID())) == "$animal_kobold" then
	local no_cooldown = true

	for _, ch in ipairs(EntityGetAllChildren(EntityGetParent(GetUpdatedEntityID())) or {}) do
		if EntityGetName(ch) == "ln_sex_cooldown" then
			no_cooldown = false
			break
		end
	end

	if no_cooldown == true and ComponentGetValue2(EntityGetFirstComponent(EntityGetParent(GetUpdatedEntityID()), "DamageModelComponent"), "is_on_fire") == false then
		local futa_scene = EntityCreateNew("wizard_futa_orb")
		local kobold_x, kobold_y = EntityGetTransform(EntityGetParent(GetUpdatedEntityID()))

		SetRandomSeed(kobold_x, kobold_y)

		if Random(0, 1) == 1 then
			EntitySetTransform(futa_scene, kobold_x, kobold_y, 0, 1, 1)
		else
			EntitySetTransform(futa_scene, kobold_x, kobold_y, 0, -1, 1)
		end

		EntityAddChild(futa_scene, EntityGetParent(GetUpdatedEntityID()))

		EntityAddComponent2(futa_scene, "LuaComponent", {
			script_source_file="mods/lewd_noita/files/sex_logic/sex_scene.lua"
		})
	end
end