function onTouch(part) Fire=Instance.new("Fire") Fire.Parent=part fire=part:FindFirstChild("Fire") if fire then Fire:Destroy() --Line I need help with and also have the function not do anything. end end a=game.Workspace.FirePart a.Touched:connect(onTouch)
Here is a basic script from the Roblox site that I wanted to change a little.
If you look at the function onTouch, towards the end where it says if fire is there then have the block not do anything end. However, I do not know how to do that.
Although what you are doing may work the fire would be created regardless of whether there is already a fire in the part because the lines to create your fire is outside the if statement. If you want the script to check the part for fire before creating anything as you've described you want something like this:
function onTouch(Part) if not Part:FindFirstChild("Fire") then --Create the fire in the part. end end
The if statement will check the part and if the part does NOT have a fire it will run the block. If it does have the fire the block will skip entirely and no fire will spawn.