Yep, good catch! If you wanted to have x dynamically update, couple things you could do…

Systematically upload a new asset and get it’s id. This would involve some external web services, I personally wouldn’t know where to start with that. This would be horribly complicated

Create a function to “search” for x

Write a “guess” for x that would be insanely large.

Try this, see if it is a valid Id

If it is not valid, divide x by 2 and try again.

Eventually, you will have a value x that is invalid and a value x/2 that is valid. You now have a range for an upper bound

Split the range of [x/2, x] down the middle (mid = (x + (x/2))/2 = (3x/4)). Query this value.

If mid is valid, then you know the upper bound exists in [(3x/4), x]. If it is invalid, you know it is in [x/2, (3x/4)]. Repeat this as an interative process until you reach a range of size 1. This is your final value.

Now, this logic presumes that "rbxassetid://"..x" is valid for all values of x from 1 to x (which is not the case I’m afraid - infact, a majority of your “guesses” will be invalid)

Conclusion being… do you really need to do this? Is there a simpler solution that will achieve the same/similair outcome for you?