|
| 05 Aug 2010 10:13 PM |
I want to make a script for my cars that allows it to drive and hit things, and when it hits a certain number of things, it will create smoke out of the hood as it takes on more and more damage, and when it hits too many things, it will catch the hood on fire and explode in 10 seconds, and the remains of the car will be black and on fire. (But I want the fire to go out over 20 seconds.) Thanks 4 reading this, and if you can, please help me. :D
Xx werewolf2747 xX |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2010 10:18 PM |
| I really wish someone would just say something! |
|
|
| Report Abuse |
|
|
| |
|
filhynate
|
  |
| Joined: 08 Jun 2010 |
| Total Posts: 48 |
|
|
| 05 Aug 2010 10:21 PM |
| ok, well I dont know....thats a hard one...hmmmm well...I believe that an advanced scripter might now...im sorry im a new scripter |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Aug 2010 10:24 PM |
hits = 0 phaseone = 4 --How many objects it has to hit until it smokes. phasetwo = 9 --How many objects it has to hit until it sets on fire. function onTouch(hit) if hits > phaseone and hit < phasetwo then local z = Instance.new("Smoke") z.Color = Color3.new(51,51,51) z.Parent = script.Parent elseif hit >phasetwo then local f = Instance.new("Fire") f.Parent = script.Parent wait(10) local e = Instance.new("Explosion") e.Position = script.Parent.Position e.BlastPressure = 900000 e.Parent = script.Parent local children = script.Parent.Parent:GetChildren() for i = 1,#children do if children[i].className == "Part" or children[i].className == "WedgePart" then local fire = Instance.new("Fire") fire.Parent = children[i] end end end end
script.Parent.Touched:connect(onTouch)
Put this in any brick that you want to take dammage. Make sure that every part is in the Chasis. |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2010 10:26 PM |
function t() script.BoolValue.Value = script.BoolValue.Value + 1 end
function crash() if script.BoolValue.Value == 20 then V = Instance.new("Explosion") V.Position = script.Parent.Position V.Parent = Script.Parent end end
script.Parent.Touched:connect(t) script.BoolValue.Changed:connect(crash)
Errors will be found, because this is untested, and I made it in the forum. |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2010 10:27 PM |
Oops. Forgot one thing.
New Version:
hits = 0 phaseone = 4 --How many objects it has to hit until it smokes. phasetwo = 9 --How many objects it has to hit until it sets on fire. function onTouch(hit) if hits > phaseone and hit < phasetwo then local z = Instance.new("Smoke") z.Color = Color3.new(51,51,51) z.Parent = script.Parent elseif hit >phasetwo then local f = Instance.new("Fire") f.Parent = script.Parent wait(10) local e = Instance.new("Explosion") e.Position = script.Parent.Position e.BlastPressure = 900000 e.Parent = script.Parent local children = script.Parent.Parent:GetChildren() for i = 1,#children do if children[i].className == "Part" or children[i].className == "WedgePart" then local fire = Instance.new("Fire") fire.Parent = children[i] end end end hits = hits + 1 end
script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Aug 2010 10:31 PM |
Oops. A boolValue woldn't work. *facepalm*
Use a IntValue or NumValue |
|
|
| Report Abuse |
|
|