miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 28 Apr 2012 10:36 PM |
script.Parent.Equipped:connect(function(mouse) script.Parent.Activated:connect(function() local pos, hit = script.Parent.Handle.Position, mouse.Hit.p local magnitude = (pos - hit).magnitude script.Parent.Parent = game.Workspace script.Parent.Handle.Velocity = -(pos - hit).unit*magnitude/2 + Vector3.new(0, magnitude, 0) end) end)
So, this is a tool. what I want is when I click it the basketball goes forward where the mouse is hit. Like, a regular basketball. But I keep on getting this output.
This Mouse is no longer active 22:35:51 - Script "Workspace.Basketball.Throw", Line 3 22:35:51 - stack end
Help?
Not good with tools, yeah know :/ |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
|
| 28 Apr 2012 11:04 PM |
| Question : Why'd you use .Activated with .Equipped? .Activated runs when the tool is equipped at the user clicks. So .Equipped is pretty much completely worthless. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 28 Apr 2012 11:08 PM |
| It's arguement is mouse. I use mouse for mouse.Hit.p. |
|
|
| Report Abuse |
|
|
| |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 28 Apr 2012 11:19 PM |
Because when I first tried that nothing happened.
Do you know what's wrong? |
|
|
| Report Abuse |
|
|
TwoBoo
|
  |
| Joined: 08 Feb 2011 |
| Total Posts: 10790 |
|
|
| 28 Apr 2012 11:39 PM |
| Your 6th line confuzzles me. |
|
|
| Report Abuse |
|
|
| |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 29 Apr 2012 02:16 AM |
unit*magnitude = original vector
Inefficient... |
|
|
| Report Abuse |
|
|