How would I make an automatic cannon using projectiles?

I saw this post by @EgoMoose (linked below for anyone needing it). It helped, but his system has a start, end and time, I don’t have an end. I am trying to make a cannon randomly have a rotation, and go a certain distance based on that. How can I do this?

EgoMoose’s post:

You need to know one more thing, either the power of the cannon or the travel time for the projectile. Is that fine for your use case?

EDIT: Oh, you also need to know the strength of gravity

That seems fine. I can just set a default power how would I go about to do this?

In that case, you can just choose a random start direction. Then the initial velocity is that direction * the cannon power. Just do

local CANNON_POWER = 100

function randDir()
    local dir
    repeat
        dir = Vector3.new(
            (math.random() - 0.5) * 2,
            (math.random() - 0.5) * 2,
            (math.random() - 0.5) * 2
        )
    until dir.Magnitude <= 1
    return dir.Unit
end

ball.Velocity = randDir() * CANNON_POWER

But if you’re not trying to make the ball go to a specific point, then what are you try to do?

The cannon has a random orientation, inside of my limits, and it will prompt users to try to guess where it lands, then it fires and whoever is closet wins