Hey guys, I have this really big problem with my hoses. They do not use objects, but particle streams. It is the parent of the tool, not the emitter. This is the code:
local touch = false
script.Parent.Touched:connect(function(hit)
if not touch then
touch = true
if hit:FindFirstChild("Fire") then
if (hit.Fire.Heat >= 0) then
hit.Fire.Heat = hit.Fire.Heat - 7
touch = false
else
hit.Fire:Destroy()
for i,v in pairs(hit:GetChildren()) do
if v:IsA("ParticleEmitter") or v.Name == "FireLight" then
v:Destroy()
touch = false
end
end
end
end
script.Parent:Destroy()
end
end)
wait(0.3)
script.Parent.BodyThrust:Destroy()
wait(0.7)
script.Parent:Destroy()

14 comments
Any errors in the output? If this is a tool, tools don't have Touched events.
why are there brackets on line no.6
Because you are not a firefighter.
it's a fire object, not a particle emitter
firefighter?
why are there brackets on line no.6What's wrong with it? Btw, those're parentheses.I ment line 17
ugh...i ment line 7
In programming languages such as Java, parentheses or First (Round) Bracket is required during conditional statements. In Lua however, it isn't necessary but does no harm in putting it.
ok...whoa i got a -21... wow.
hit is equal to the players humanoid, if you meant to put the fire in the players character just do hit.Parent if you meant to put it in humanoid then idk
I wanted it to put out a fire on another brick.
fire:destroy()
Particles don't have a touched Event