Making a mobile shoot button that stops shooting when you release the button but you can release even without releasing on the button

yeah this is a very long title, but in simpler terms, most shooter games outside of roblox on mobile has this function where you can start holding down the shoot button, then it starts shooting, then stops when you let go of the button. Thing is, this also allows you to keep shooting even though you’re not over the button anymore, as long as you start shooting on the button and slide your flinger elsewhere while still down, you still shoot. how can i replicate this in roblox?

if u dont understand here’s an explanation

the x and check are whether or not the button is activated.
the hand cursor shows the thumb is down
the normal cursor shows the thumb is up

thanks!