Hi, I’m trying to code a lava block (kill block) that when you touch it slowly does damage. it’s not working and I’m not sure why (sorry I’m really new at coding) Heres the code
local Lava = script.Parent
local DamageAmount = 10
local function DealDamage(part)
local hum = part.Parenet:FindFirstChild(“Humanoid”)
if hum then
hum.Heath = hum.Heath - DamageAmount
Well, firstly when using a block of code say ```lua at the start then the same without lua at the end. LavaBox is what you use for the touch event, however LavaBox is not defined, try using Lava.Touched. Also where you use local hum = part.Parenet:FindFirstChild(“Humanoid”), you should be saying part.Parent not Parenet.