Ive used a find nearest torso script and edited it, but it wont do anything. No output in the script analysis

local larm = script.Parent:FindFirstChild("Left Arm")
local rarm = script.Parent:FindFirstChild("Right Arm")
local human = nil
function findNearestTorso(pos)
	local list = game.Workspace:children()
	local torso = nil
	local dist = 30
	local temp = nil
	
	local temp2 = nil
	for x = 1, #list do
		temp2 = list[x]
		if (temp2.className == "Model") and (temp2 ~= script.Parent) and game.Players:GetPlayerFromCharacter(temp2)~=nil then
			temp = temp2:findFirstChild("Right Arm")
			human = temp2:findFirstChild("Humanoid")
			if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
				if (temp.Position - pos).magnitude < dist then
					torso = temp
					dist = (temp.Position - pos).magnitude
				end
			end
		end
	end
	return torso
end




while true do
	wait()
	local target = findNearestTorso(script.Parent.Torso.Position)
	if target ~= nil then
		human:TakeDamage(10)
	end

end

7 comments

0

Can you post the script pls in a code block.

0

Heh free model script. seen this before.

0

lol

0

from a rpg kit

0

What's it do? How is that different from what it's supposed to do?

0

Not enough information.

0

Dont ask us to make a free model work for you. You wouldnt even understand what all of this does..