I've tried really hard to understand how parameters work in Lua, but I didn't understand yet.
This is de code: It basically kill someone when touched.
function onTouch(part)
local player = part.Parent:FindFirstChild("Humanoid")
if(player ~= nil) then
player.Health = 0
end
end
script.Parent.Touched:Connect(onTouch)
My question is, how "part" is a valid parameter? What the Script does to use part as a parameter?
In my mind there is no sense, part is not even defined, and this Script works.
Thanks so much!