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

Script isn't checking the if statements. How do I fix this?

Asked by 4 years ago
01if hit.Material == Enum.Material.Wood then
02 
03    if hit.IsBurning.Value == true then
04        return
05 
06    elseif hit.IsBurning.Value == false then
07 
08        if hit:FindFirstChild("FireSpreadNormal") then
09            return
10        else
11            local catchTime = math.random(5, 10)
12            wait(catchTime)
13 
14            hit:BreakJoints()
15            hit.IsBurning.Value = true
View all 32 lines...

So, I am making a fire spreading script and I wanted to make the fire not spread to parts/objects that are made of non-burnable materials such as concrete. For some reason the script does not follow the if statements but just does first "if". I have no idea why this isn't working.

P.S: "hit" is a variable for the part that touched the burning part. <<--- Don't know if that will help but just in case.

0
do you know how to use return Blackbooks 138 — 4y
0
Do you have it on a constant loop? blocky010101 23 — 4y
0
You are using return after 2nd if statement... So the script will stop there Feelings_La 399 — 4y
0
Oops, my bad. I think you have a constant loop in your script that is above your if statement? Feelings_La 399 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You should put the line 30&31 to line 05 because your actually checking if the part is not burning before the part material

Ad

Answer this question