|
| 04 Oct 2012 07:20 PM |
So this is the script:
local bubble = script.Parent
bubble.Touched:connect(function(part) parts = part:GetChildren() if part.Fire then -- line 5 part.Fire.Enabled = false part.Smoke.Enabled = false part.ls.Disabled = true wait(3) part.Fire.Enabled = true part.Smoke.Enabled = true part.ls.Disabled = false else wait(0.1) end bubble:remove() end)
It works, however, after the wait(3) it doesn't work. So it disables the fire and all that. The fire should start up again after the wait in which it doens't. I'm also getting this error a lot:
Fire is not a valid member of Part 17:18:41 - Script "Workspace.Part.ExtinguishScript", Line 5 17:18:41 - stack end |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
HaxHelper
|
  |
| Joined: 19 Dec 2009 |
| Total Posts: 1208 |
|
|
| 04 Oct 2012 09:11 PM |
It seems like your problem is being cause by indexing the objects directly instead of using :findFirstChild().
I would change "part.Fire" and "part.Smoke" to "part:findFirstChild("Fire")" and "part;findFirstChild("Smoke")"
Also, you may want to change ":remove()" to ":destroy()" |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2012 03:21 PM |
local bubble = script.Parent
bubble.Touched:connect(function(part) parts = part:GetChildren() if part.Name == "Fire" then a = part:findFirstChild("Fire") b = part:findFirstChild("Smoke") c = part:findFirstChild("ls") a.Enabled = false b.Enabled = false c.Disabled = true wait(3) a.Enabled = true b.Enabled = true c.Disabled = false else wait(0.1) end bubble:remove() end)
Still doesn't work fully. What the script is suppose to do is take out the fire.. which it does. However, after three seconds it won't enable the fire again. |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2012 03:24 PM |
| is the bubble touching the fire when the fire starts again, because you have else, under the if that only starts when the bubble is touching... |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2012 03:58 PM |
| I don't understand what you just said. If so how would I fix it? |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2012 04:05 PM |
| you need a seperate function for allowing the fire to come back on basically |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2012 04:06 PM |
| I'm confused. Post what you mean please. |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2012 04:07 PM |
local bubble = script.Parent
bubble.Touched:connect(function(part) parts = part:GetChildren() if part.Name == "Fire" then a = part:findFirstChild("Fire") b = part:findFirstChild("Smoke") c = part:findFirstChild("ls") a.Enabled = false b.Enabled = false c.Disabled = true print("1") wait(3) print("2") a.Enabled = true b.Enabled = true c.Disabled = false print("3") else wait(0.1) end bubble:remove() end)
It only prints 1. If that helps. |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 06 Oct 2012 04:08 PM |
| I coded this awhile ago, sadly it only works at my script builder (which can be found on my profile) because it uses InsertService: cannot post it here, so go to pastebin.com/H43LUU5x |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2012 04:09 PM |
| Well no lol. I need it to work at MY place. |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 06 Oct 2012 04:10 PM |
| Okay, so look at how I made the foam work and try to implement it. |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 06 Oct 2012 04:11 PM |
| Although it isn't my most efficient piece of coding, because it was made awhile ago and I only made it for simple use so didn't really care much about it. |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2012 04:16 PM |
| Yeah I'm not understanding too much of your code. :P |
|
|
| Report Abuse |
|
|
| |
|
rayoma
|
  |
| Joined: 13 Nov 2009 |
| Total Posts: 1911 |
|
|
| 07 Oct 2012 03:38 PM |
local bubble = script.Parent bubble.Touched:connect(function(part) parts = part:GetChildren() if part:findFirstChild("Fire") then -- line 5 part.Fire.Enabled = false part.Smoke.Enabled = false part.ls.Disabled = true wait(3) part.Fire.Enabled = true part.Smoke.Enabled = true part.ls.Disabled = false else wait(0.1) end bubble:remove() end) |
|
|
| Report Abuse |
|
|