How to calculate the necessary velocity of the projectile

So, I was looking some Roblox games and I saw two games with an interessant mechanic: Goal Kick Simulator and Home Run

The mechanic in this case is the trajectory that the ball does to the goal
I readed some articles about things like that but no one seemed to help that much, one of them was this, it was the one that most approached from what I want but the ball goes too much upward

So my question is, how can I make an mechanic like the one that is used in the games?