|
| 20 May 2013 01:10 AM |
| I'm knew at scripting. I know how tho change the properties and use wait(). I also know how to print things and some basic functions like remove. Ive been wanting to make a car that you can script to when you go a certain speed it blows up. But I don't know how to and what that function is. Please help a newbie out! :) |
|
|
| Report Abuse |
|
|
|
| 20 May 2013 01:11 AM |
| new* sorry I had to correct myself.... |
|
|
| Report Abuse |
|
|
loleris
|
  |
| Joined: 23 Feb 2009 |
| Total Posts: 1610 |
|
|
| 20 May 2013 01:30 AM |
Here you go:
-- put this script inside a car front part or something max_velocity = 200 part = script.Parent part.Hit:connect(function() local v = part.Velocity if (v.x + v.y + v.z) > max_velocity then local explosion = Instance.new("Explosion", Workspace) explosion.Position = part.Position end end) |
|
|
| Report Abuse |
|
|
inatorman
|
  |
| Joined: 17 Jun 2011 |
| Total Posts: 113 |
|
|
| 20 May 2013 04:25 AM |
this script /\ could also make realistic damage car accidents. |
|
|
| Report Abuse |
|
|
loleris
|
  |
| Joined: 23 Feb 2009 |
| Total Posts: 1610 |
|
|
| 20 May 2013 04:44 AM |
UPDATE The script I posted earlier had a bug. This one will work right
-- put this script inside a car front part or something max_velocity = 200 part = script.Parent part.Hit:connect(function() local v = part.Velocity if (math.abs(v.x) + math.abs(v.y) + math.abs(v.z)) > max_velocity then local explosion = Instance.new("Explosion", Workspace) explosion.Position = part.Position end end) |
|
|
| Report Abuse |
|
|
|
| 24 May 2013 10:09 PM |
| Thanks I get like 3/4 of this... :) |
|
|
| Report Abuse |
|
|