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

0

Any errors in the output? If this is a tool, tools don't have Touched events.

0

why are there brackets on line no.6

3

Because you are not a firefighter.

0

it's a fire object, not a particle emitter

0

firefighter?

0

why are there brackets on line no.6 What's wrong with it? Btw, those're parentheses.

0

I ment line 17

0

ugh...i ment line 7

0

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.

0

ok...whoa i got a -21... wow.

0

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

0

I wanted it to put out a fire on another brick.

0

fire:destroy()

0

Particles don't have a touched Event