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

How to make a flamethrower make something catch fire, then kill the flames after around 10 seconds?

Asked by 9 years ago

So basically, I have this flamethrower... It shoots out flames, which are just parts... When a part comes in touch with these flames, that object has a fire created inside it. Making it 'catch fire' I want it so that once it has caught fire, around 10 seconds later, it dies out... How can I do that? Here's my script at the moment:

script.Parent.Parent.Touched:connect(function(hit) 

if hit.Parent:IsA("Model") then 
local f = Instance.new("Fire", hit) -- Creates a fire object in the part that was touched. 
f:Remove()          -- I want the fire to be removed...
print(f.Parent)

f.Parent = hit      -- But I don't want the parts to not get fire put into it anymore...
print(f.Parent)
        -- Add/Adjust fire properties here. 
hit:BreakJoints() -- Breaks the touched part's joints. 

end 
end)


-- What I want is the fire, which is put into the part(s), to die out every 10 seconds.

Thx, help would really be appreciated This is also linked to this question: https://scriptinghelpers.org/questions/13069/how-do-you-make-flames-wrap-around-an-object-which-it-cant-go-through-like-a-real-flamethrower

Answer this question