gansest
|
  |
| Joined: 08 Apr 2010 |
| Total Posts: 609 |
|
|
| 01 Jul 2013 11:58 AM |
function OnTouch(hit) if debounce == false then debounce = true val = Instance.new("NumberValue", script) hum = hit.Parent:FindFirstChild("Humanoid") --hum.Parent:MoveTo(hum.Parent.Torso.Position + Vector3.new(0, 10, 0)) -- This part. I need the target fly away inversed as he was shot hum.Parent.Torso.Anchored = false while true do val.Value = val.Value + 1 hum.Parent:MoveTo(hum.Parent.Head.Position + Vector3.new(1, 0, 0)) -- Attempt, but he flies to one direction only. wait() if val.Value == 50 then break end end hum:TakeDamage(20) val:remove() end debounce = false end end Tool.Handle.Touched:connect(OnTouch)
How to make it fly away from the player that hit the target? I have no idea how this method is called, or how to search in wiki, but if you could, please send some script lines about it |
|
|
| Report Abuse |
|
|
gansest
|
  |
| Joined: 08 Apr 2010 |
| Total Posts: 609 |
|
|
| 01 Jul 2013 12:35 PM |
I also tried
hum.Parent:MoveTo(hum.Parent.Torso.CFrame == me.Torso.CFrame():inverse())
but still, gives me an error. |
|
|
| Report Abuse |
|
|
|
| 01 Jul 2013 01:19 PM |
Ok first of all rename the function to onTouch and in the connection line. It is just plain irritating me. Next, double check the vector values and make sure they are what you want.
~-Scripting can make ANYTHING-~ |
|
|
| Report Abuse |
|
|
|
| 01 Jul 2013 01:20 PM |
| Oh and also you need to learn about bodyvelocity and that sort a stuff. I specialize in GUI's so I can only help you a little bit with this sort of subject. |
|
|
| Report Abuse |
|
|
|
| 01 Jul 2013 01:21 PM |
OH and also you forgot an end here " if debounce == false then debounce = true " |
|
|
| Report Abuse |
|
|
|
| 01 Jul 2013 01:23 PM |
| And finally, when you do this line, "val = Instance.new("NumberValue", script)" try to set the parent of the number value in a new line. Such as "val.Parent = game.Workspace.script" or whatever the name is of your script. Also rename the script. |
|
|
| Report Abuse |
|
|
|
| 01 Jul 2013 01:26 PM |
Man, are there a lot of errors..... Ok next is these two lines.
" --hum.Parent:MoveTo(hum.Parent.Torso.Position + Vector3.new(0, 10, 0)) " " hum.Parent:MoveTo(hum.Parent.Head.Position + Vector3.new(1, 0, 0)) "
Remove the double parenthesis plox |
|
|
| Report Abuse |
|
|
|
| 01 Jul 2013 01:26 PM |
| Oh and lastly, you forgot t set the wait timer.... |
|
|
| Report Abuse |
|
|
gansest
|
  |
| Joined: 08 Apr 2010 |
| Total Posts: 609 |
|
|
| 01 Jul 2013 02:07 PM |
| The script I wrote works PERFECTLY, I'd know if there are errors. I just need somebody to explain how to Push the target away from creator |
|
|
| Report Abuse |
|
|
Thaeh
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 7685 |
|
|
| 01 Jul 2013 02:10 PM |
Simplest way is to create a BodyForce. You also need to use .lookVector or the player's head/torso/whatever and assign a value negative to where he is facing. |
|
|
| Report Abuse |
|
|
gansest
|
  |
| Joined: 08 Apr 2010 |
| Total Posts: 609 |
|
|
| 01 Jul 2013 02:29 PM |
| uh... I'll try that. Sounds complicated. |
|
|
| Report Abuse |
|
|