Disable some of site’s scripts if users device is a mobile (small screen) [closed]

im new to codeing space

i have a site with Auto scroller on,(by a tiny scroll the entire page scrolls down)
Now i want to turn auto scrolling off if user is on mobile

Thanks

<script src="./fullpage.min.js"></script>
    <script>
        new fullpage('#fullPage', {
            autoScrolling: true,
            navigation:true,
            anchors:['section1' , 'section2', 'section3','section4','section5'],
            navigationTooltips: ['Main Page', 'Roya' , '!LET GO','Future', 'Page 6',]
        })
    </script>

have seen some other posts like “This
but can’t make it work