Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

			if hit.Material == Enum.Material.Wood then
				
				if hit.IsBurning.Value == true then
					return
						
				elseif hit.IsBurning.Value == false then
					
					if hit:FindFirstChild("FireSpreadNormal") then
						return
					else
						local catchTime = math.random(5, 10)
						wait(catchTime)
						
						hit:BreakJoints()
						hit.IsBurning.Value = true
						hit.Anchored = false
						hit.BrickColor = BrickColor.new("Black")
						
						if hit:FindFirstChild("FireSpreadNormal") then
		
						else
							SpreadFireScript(hit)
						end
						
						
					end
				
				end
				
			elseif hit.Material == Enum.Material.Concrete then
				print("Cannot burn")
			end

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.

4 comments

0

do you know how to use return

0

Do you have it on a constant loop?

0

You are using return after 2nd if statement... So the script will stop there

0

Oops, my bad. I think you have a constant loop in your script that is above your if statement?

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.