Hi, I am making a group rank door. Only certain ranks or above can go through. But if not the right rank, I want the person to be killed to be set back to spawn. I have it working, but I need helping understanding certain parts.
function onTouched(part) -- part? What is that? I know it is a Parameter. What does it do?
if game.Players.LocalPlayer:GetRankInGroup(2934469) >= 10 then
script.Parent.CanCollide = false
elseif part.Parent:FindFirstChild("Humanoid") ~= nil then -- part here? What does it do?
part.Parent.Torso:BreakJoints() -- part here? What does it do?
end
end
script.Parent.Touched:connect(onTouched)
Thanks, Vincent Lauro

1 comment
"(part)" is the part that touched this part. "part.Parent:FindFirstChild("Humanoid")" checks if there is an humanoid. if there is one, it kills the model.