|
| 23 Apr 2015 04:30 PM |
I made a script where when you push "e" the ball gets shot. The output says nothing and there's no syntax errors. Help please.
script:
plr=game.Players.LocalPlayer mouse=plr:GetMouse() ball=script.Parent char=ball.Parent hum=char:WaitForChild("Humanoid") targetPos = hum.TargetPoint v = (targetPos - char.Head.Position).unit spawnPos = char.PrimaryPart.Position
mouse.KeyDown:connect(function(key) if (key=="e") then spawnPos=spawnPos+(v*5) hum.Jump=true wait() ball.Parent=workspace ball.Handle.Position=spawnPos ball.Handle.Velocity=(v*ball.PowerValue.Value)+Vector3.new(0,50,0) end end) |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2015 05:02 PM |
You should learn to debug on your own.. print()
Try moving the script into PlayerGui |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2015 05:28 PM |
Ok so u cant make a part move by setting the Parts velocity you need to create an instance inside the part Called "BodyVelocity" you can look up more about it in the wiki |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2015 05:33 PM |
@dark
It's a local script and it's in the PlayerGui. |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Apr 2015 05:42 PM |
| But how do i make it rise up or forward in mid air? |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Apr 2015 05:55 PM |
| In the BodyVelocity properties do i change the velocity to make the ball go farther or the P property? |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2015 05:57 PM |
| nvm i found the answer to that question. |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2015 06:01 PM |
It says this in the output because of this part:
ball.BodyVelocity.velocity=Vector3.new(0,v,0)
19:00:38.685 - Workspace.Player1.LBA_Ball.shot:14: bad argument #2 to '?' (Vector3 expected, got number)
??? |
|
|
| Report Abuse |
|
|