Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my hose script not putting out a fire?

Asked by 5 years ago

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()
0
Any errors in the output? If this is a tool, tools don't have Touched events. User#19524 175 — 5y
0
why are there brackets on line no.6 Tizzel40 243 — 5y
3
Because you are not a firefighter. Zafirua 1348 — 5y
0
it's a fire object, not a particle emitter theking48989987 2147 — 5y
View all comments (10 more)
0
firefighter? Tizzel40 243 — 5y
0
`why are there brackets on line no.6 ` What's wrong with it? Btw, those're parentheses. TheeDeathCaster 2368 — 5y
0
I ment line 17 Tizzel40 243 — 5y
0
ugh...i ment line 7 Tizzel40 243 — 5y
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. Zafirua 1348 — 5y
0
ok...whoa i got a -21... wow. Tizzel40 243 — 5y
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 Donut792 216 — 5y
0
I wanted it to put out a fire on another brick. Wesser205 0 — 5y
0
fire:destroy() ReallyUnikatni 68 — 5y
0
Particles don't have a touched Event Synth_o 136 — 5y

Answer this question