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

	if EntityGetAllChildren(EntityGetParent(GetUpdatedEntityID())) ~= nil then
		for i, ch in ipairs(EntityGetAllChildren(EntityGetParent(GetUpdatedEntityID()))) do
			if EntityGetName(ch) == "sex_cooldown" then
				no_cooldown = false
			end
		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