Hello! Newbie Developer here! I’m wondering what the parameter does in this code? I’ve read the developer website and still i didn’t understand anything about it
Code:
local lava = script.Parent
local function killPlayer(otherPart)
local partParent = otherPart.Parent
local humanoid = partParent:FindFirstChild(“Humanoid”)
if humanoid then
humanoid.Health = 0
end
end
local lava = script.Parent
local function killPlayer(otherPart)
local partParent = otherPart.Parent --Getting the parent of the model
local humanoid = partParent:FindFirstChild(“Humanoid”) --Checks if there is a humanoid
if humanoid then --If it has a humanoid then
humanoid.Health = 0 --Changes humanoid health to 0
end
end
lava.Touched:Connect(killPlayer) --Touch function