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 ??
Try this:
function onTouched(hit) if script.Parent.CanCollide ~= false then -- here local h = hit.Parent:findFirstChild("Humanoid") if h ~= nil then h.Health = 0 end end end script.Parent.Touched:connect(onTouched)
The script is looking if the block can colide where i put this "-- here" if it does not collide it wont go any further. Let me know if it works.