Hello everyone, I am a beginner scripter and i have some issues with a lava block script, here is the reason: block keeps killing me if its invisible, here is the script:
function onTouched(hit)
local h = hit.Parent:findFirstChild("Humanoid")
if h ~= nil then
h.Health = 0
end end script.Parent.Touched:connect(onTouched)
Do someone have any suggestion to fix this ??

3 comments
Try this: function onTouched(hit) if script.Parent.CanCollide ~= false then local h = hit.Parent:findFirstChild("Humanoid") if h ~= nil then h.Health = 0 end end end script.Parent.Touched:connect(onTouched)
I want to try but how i could line that
Remove the health with h.Health = h.Health - 100