of     1   

bulldogslucky13
#152906566Wednesday, December 31, 2014 5:47 PM GMT

Hello! Here is my dilemma. I have been trying very hard to make a smooth working football that allows the user to click and hold to choose power of throw, and release to throw. Whilst this is happening, they can choose where they want to throw it by aiming the mouse. I was wondering if anyone had any ideas for what I need to do to achieve this goal, or if anyone would be willing to make one for me. I would be willing to pay quite generously, but of course, I would like to build it myself if possible. Thank you in advance! Respectfully, bulldogslucky13
Bluseph
#152907103Wednesday, December 31, 2014 5:53 PM GMT

A very nicely made mesh would probably achieve your goal of making a realistic football. For the scripting, it is possible if you know how to do so.
bulldogslucky13
#152907341Wednesday, December 31, 2014 5:56 PM GMT

@bluejays1236 Thanks for responding! I have the mesh down, just not the scripting part, and that's what I'm talking about
Randy_Moss
#152907655Wednesday, December 31, 2014 6:00 PM GMT

local speed = 100 local distance = 75 You will need this. The code comes after this just to make scripting easier :)
bulldogslucky13
#152907723Wednesday, December 31, 2014 6:00 PM GMT

@killer4723 Thanks for the start!
Scriptos
#152908175Wednesday, December 31, 2014 6:06 PM GMT

"I'd like to build it myself if possible." Tips, then? Use a LocalScript so that you can get the player's mouse. ( local mouse = game.Players.LocalPlayer:GetMouse(); ) Use the lookVector property of the position of the mouse to get the direction you want to throw to. ( local dir = mouse.Hit.lookVector; ) Multiply dir by the power you need to throw the ball. ( Can use mouse.Button1Down and mouse.Button1Up to get how long the player holds down the button to throw. This will get you the power needed to multiply by direction.) You might want to add a maximum power so they can't throw the ball to the moon.
bulldogslucky13
#152908687Wednesday, December 31, 2014 6:12 PM GMT

@scriptos thanks for the help. If I were to use mouse.Button1Down and mouse.Button1Up to get how long the player holds down the button to throw, what would I do to get the time in between the click down and up? How would I get the needed information, and store it, or use it? Like, how would I count how long it is being held? Thanks!
Scriptos
#152909032Wednesday, December 31, 2014 6:17 PM GMT

local mouse = game.Players.LocalPlayer:GetMouse(); local timeHeld = 0; mouse.Button1Down:connect(function() timeHeld = tick(); end); mouse.Button1Up:connect(function() timeHeld = tick()-timeHeld; print(timeHeld); end);
bulldogslucky13
#152910145Wednesday, December 31, 2014 6:29 PM GMT

@Scriptos right. Thank you!
bulldogslucky13
#152910488Wednesday, December 31, 2014 6:33 PM GMT

Any ideas for how to get the ball flying through the air, and falling with gravity? With time in the air dependent upon the power used to throw?
Tigeon
#152915589Wednesday, December 31, 2014 7:32 PM GMT

doesnt roblox already have gravity
bulldogslucky13
#152915864Wednesday, December 31, 2014 7:36 PM GMT

Yes. Thank you all for your help, and I have figured it out!

    of     1