Okay, so I'm not entirely sure if these questions are allowed, but if they are, feel free to reply. This is not my script. It is one I have found from a model, I wish to edit it so I can learn better and I feel it would really help me if the community could help me with a thing or two about the script I found and some things I've had trouble locating in the wiki.
Thank you so much ( I commented on the things I don't understand, the rest I get ):
local larm = script.Parent:FindFirstChild("Left Arm")
local rarm = script.Parent:FindFirstChild("Right Arm")
function findNearestTorso(pos)
local list = game.Workspace:children()
local torso = nil
local dist = 1000
local temp = nil --Why make a variable for nil?
local human = nil -- ^^
local temp2 = nil -- ^^
for x = 1, #list do
temp2 = list[x] -- What exactly is the [x] for? Is this restating or..?
if (temp2.className == "Model") and (temp2 ~= script.Parent) then
temp = temp2:findFirstChild("Torso")
human = temp2:findFirstChild("Zombie")
if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
if (temp.Position - pos).magnitude < dist then
torso = temp -- nil to nil? do not understand
dist = (temp.Position - pos).magnitude
end
end
end
end
return torso
end
Again, thanks. Just a few things I pointed out and hope you can clarify. Cheers :)

2 comments
Thank you. This makes a lot of sense.
Awesome. Glad to help :P