|
| 10 Jun 2014 09:29 PM |
I'm making a basic fire spreading script, where I want bricks to catch fire if they come into contact with other fire bricks. Eventually, I want the .Touched event to disconnect. This is what I currently have, but I get an error saying it's a depreciated method.
--not exactly what I have, just basic
function addFire(part) --put fire in the part part.Touched:connect(function(hit) if hit:IsA("BasePart") then wait(5) addFire(hit) wait(15) part.Touched:disconnect() --this is where I get the error end end) end
|
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Jun 2014 09:34 PM |
@cnt
Help me pl0x
★ Offering Emp + R$15 for Domino Crown ★ |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Jun 2014 09:35 PM |
@very
Thanks for the useful advice.
★ Offering Emp + R$15 for Domino Crown ★ |
|
|
| Report Abuse |
|
|
|
| 10 Jun 2014 09:35 PM |
actually
local func=Workspace.Part.Touched:connect(function() print'hi' end) func:disconnect() |
|
|
| Report Abuse |
|
|
|
| 10 Jun 2014 09:36 PM |
Oh, thank you.
★ Offering Emp + R$15 for Domino Crown ★ |
|
|
| Report Abuse |
|
|
|
| 10 Jun 2014 09:37 PM |
Actually, it's saying 'event' is a nil value. This is the script copied and pasted.
local event = hit.Touched:connect(function(touch) if touch:IsA("BasePart") and not touch.Parent:FindFirstChild("Humanoid") and touch.Name ~= "Platform" and not touch:FindFirstChild("Fire") then wait(5) addFire(touch) wait(15) event:disconnect() elseif touch.Parent:FindFirstChild("Humanoid") then touch.Parent.Humanoid:TakeDamage(2.5) end end)
★ Offering Emp + R$15 for Domino Crown ★ |
|
|
| Report Abuse |
|
|
|
| 10 Jun 2014 09:42 PM |
Ahh, I found the answer on the wiki. It's kind of weird, but this is what it said:
You will soon notice that you've run into an error saying that con is a nil value. This happens because the con variable wasn't assigned before the anonymous listener was created. To get around this, all you have to do predefine the con variable:
★ Offering Emp + R$15 for Domino Crown ★ |
|
|
| Report Abuse |
|
|