-- FUNCTIONS --

CS:GetInstanceAddedSignal("OnFire"):Connect(function(Character)
	local Humanoid = Character:WaitForChild("Humanoid")
	Replicate:FireAllClients("Burn", Character, true)
	coroutine.wrap(function()
		repeat 
			Humanoid:TakeDamage(math.random(4, 12))
			task.wait(1)
		until not CS:HasTag(Character, "OnFire")
	end)()
end)

CS:GetInstanceRemovedSignal("OnFire"):Connect(function(Character)
	Replicate:FireAllClients("Burn", Character, false)
end)
