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

How could I make it do this?

Asked by 9 years ago

I have a burning fire script and you can see it below, but I want it to burn a brick after 1 second of that brick being burnt another starts with the previous one still going. Is there any way to do this? Here is my script below:

for i,v in pairs(script.Parent:GetChildren()) do
    if v.ClassName == "Part" or v.ClassName == "WedgePart" or v.ClassName == "CornerWedgePart" or v.ClassName == "TrussPart" or v.ClassName == "Seat" or v.ClassName == "VehicleSeat" or v.ClassName == "SkateboardPlatform" or v.ClassName == "UnionOperation" or v.ClassName == "NegateOperation" then
        fire = v:FindFirstChild("Fire")
        if fire == nil then
            f = Instance.new("Fire",v)
            f.Color = Color3.new(255,128,0)
            f.SecondaryColor = Color3.new(255,0,0)
            f.Enabled = true
            f.Heat = 15
            f.Size = 20
            wait(2)
            v.BrickColor = BrickColor.new("Reddish brown")
            v.Material = "CorrodedMetal"
            wait(3)
            v.BrickColor = BrickColor.new("Black")
            wait(5)
            repeat wait(0.1) f.Size = f.Size - 1 until f.Size == 2
            v.Anchored = false
        else
            fire.Color = Color3.new(255,128,0)
            fire.SecondaryColor = Color3.new(255,0,0)
            fire.Enabled = true
            fire.Heat = 15
            fire.Size = 20
            wait(2)
            v.BrickColor = BrickColor.new("Reddish brown")
            v.Material = "CorrodedMetal"
            wait(3)
            v.BrickColor = BrickColor.new("Black")
            wait(5)
            repeat wait(0.1) fire.Size = fire.Size - 1 until fire.Size == 2
            v.Anchored = false
        end
        if v ~= nil then
            wait(5)
            v:remove()
        end
    end
end
2
Is BasePart a valid instance? EzraNehemiah_TF2 3552 — 9y
1
I just see it in other scripts, I just put it there to be sure if there is a 'BasePart' it burns aswell, but the script works with it... General_Scripter 425 — 9y
2
Also: BasePart is mainly used for the IsA() method, because although an Instance's ClassName will never be 'BasePart', If you do instance:IsA("BasePart") then it will return true no matter if the instance is a part, wedge, or corner wedge. Perci1 4988 — 9y
0
I added more part names, does anyone have any way to do what I asked or not? General_Scripter 425 — 9y

1 answer

Log in to vote
-1
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago

You're using Size incorrectly on line 31. Size is a Vector3 value because it has height, width, and depth. However, you're treating it like a number value. Try this:

repeat wait(0.1) f.Size = f.Size - Vector3.new(1,1,1) until f.Size <= Vector3.new(2,2,2) --I used less than or equal to just in case it doesn't equal 2,2,2 EXACTLY, it still should work. 
1
f is the fire, not a brick however it's meant to be fire not f, fixed it now but not what I was asking for! General_Scripter 425 — 9y
Ad

Answer this question