In this video we are going to be learning about functions. This is intermediate, ALMOST advanced, so you might want to watch the other intermediate tutorials before you watch this one.
Script 1:
function lava(hit)
hit:Remove()
end
script.Parent.Touched:connect(lava)
Script 2:
function lava(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid ~= nil then
humanoid.Health = 0
end
end
script.Parent.Touched:connect(lava)
script 3:
function lava(hit)
function remove2
hit:Remove()
end
remove2()
end
script.Parent.Touched:connect(lava)