So I followed the tutorial in the ROBLOX Wiki: http://wiki.roblox.com/index.php?title=Lighting_Parts_on_Fire I feel like I wasn't satisfied with my script, so I edit it so the humanoid who touches the Lava part will get hurt in real-time. However, If the fire on the person is doused out, it will still hurt the humanoid until it dies. I've added something on line 10 that if it's destroyed, it will stop hurting the humanoid, but that doesn't work.
firePart = game.Workspace.Lava
waterPart = game.Workspace.Water
function imonfire(part)
print(part.Name .. " is on fire!")
local fire = Instance.new("Fire")
fire.Parent = part
local humanoid = part.Parent:FindFirstChild("Humanoid")
repeat
if fire:Destroy() == true then return end
wait(1)
humanoid.Health = humanoid.Health - 1
until humanoid.Health == 0
end
firePart.Touched:connect(imonfire)
function water(part)
local fire = part:FindFirstChild("Fire")
if fire then
print(part.Name .. " is not on fire anymore!")
fire:Destroy()
end
end
waterPart.Touched:connect(water)
Sorry if this doesn't make any sense.

1 comment
Thank you!