Hello! I've been trying to create a script that sets the player on fire, and causes them to take damage over time. While the effect of the fire is there, the player doesn't take any damage for some reason. This is the script
local firePart = script.Parent
firePart.Transparency = 1
local function LightOnFire(part)
local fire = part:FindFirstChild("Fire")
if not fire then
fire= Instance.new("Fire")
fire.Parent = part
while true do
game.Players.LocalPlayer.Character.Humanoid.Health =game.Players.LocalPlayer.Character.Humanoid.Health - 15
wait(5)
end
end
end
firePart.Touched:connect(LightOnFire)
-- what I want to do is add in a part to the script where if the player
--steps on the fire, they take damage

3 comments
ahh This looks nice, but is the semi colon at the end of each line required? I haven't seen anyone use them before.
And as for the function(part). Could I insert my own function to replace part?
and lastly, how would I get the player to take damage in this sense? Like how would I be able to access their health?