froylin3
|
  |
| Joined: 11 Aug 2010 |
| Total Posts: 1672 |
|
|
| 26 Nov 2012 10:40 PM |
I am new to scripting and I am trying to edit the scripts in a Jet that I made. I used scripts from another jet for the purpose of the test. I want to make my Jet shoot smoke out the back when you press P. I put:
if (key=="p") then Instance.new(Smoke, Workspace.Dragon.NewTrain.Plane.Parts.Jet) end
I wasn't sure if the instance.new would know where to put the smoke since I had such a long thing saying Workspace.Dragon..... Etc.
Is the problem the Instance.New, or is it somthing else? Please help me!
Thanks :) |
|
|
| Report Abuse |
|
|
Solotaire
|
  |
| Joined: 30 Jul 2009 |
| Total Posts: 30356 |
|
|
| 26 Nov 2012 10:41 PM |
You need quotations around the class name. Instance.new("Smoke", location) |
|
|
| Report Abuse |
|
|
froylin3
|
  |
| Joined: 11 Aug 2010 |
| Total Posts: 1672 |
|
|
| 26 Nov 2012 11:01 PM |
| Ohhhhh Thanks! I totally fogot about that! |
|
|
| Report Abuse |
|
|
froylin3
|
  |
| Joined: 11 Aug 2010 |
| Total Posts: 1672 |
|
|
| 26 Nov 2012 11:04 PM |
| Hmm, still isn't working. I will try to debug it. |
|
|
| Report Abuse |
|
|
|
| 27 Nov 2012 12:01 AM |
While you do that, you may want to consider this. With that code, every time you pressed p, it would make more smoke, and that smoke is never removed. If I were to press p rapidly, it would lag the game a lot.
-~Obly of C&G~- |
|
|
| Report Abuse |
|
|
dradra44
|
  |
| Joined: 11 Jul 2008 |
| Total Posts: 1040 |
|
|
| 27 Nov 2012 12:04 AM |
Ghost is right. I would suggest adding a local boolean, like this:
b = false
if (key=="p") then if b == false then Instance.new("Smoke").Parent = Workspace.Dragon.NewTrain.Plane.Parts.Jet b = true end end
Or, maybe waiting a set amount of time, then removing the smoke?
if (key=="p") then smke = Instance.new("Smoke") smke.Parent = game.Workspace.Dragon.NewTrain.Plane.Parts.Jet wait(5) --Set the amount here smke:Destroy() end
|
|
|
| Report Abuse |
|
|