function findTorso(t)local H=nil local u=100000 local I=workspace:children()for w=1,#I,1 do if I[w].className=="\077\111\100\101\108"then local i=I[w]:findFirstChild("\072\117\109\097\110\111\105\100")if i~=nil then local i=I[w]:findFirstChild("\072\101\097\100")if i~=nil then if(i.Position-t).magnitude<u then H=i u=(i.Position-t).magnitude end end end end end return H end;(game:GetService("\082\117\110\083\101\114\118\105\099\101")).Stepped:Connect(function()local t=findTorso(script.Parent.Position)if t~=nil then script.Parent.CFrame=CFrame.new(script.Parent.Position,t.Position)end end)

function findTorso(pos)
	local torso = nil
	local dist = 100000
	local child = workspace:children()
	for i=1, #child do
		if child[i].className == "Model" then
			local h = child[i]:findFirstChild("Humanoid")
			if h ~= nil then
				local check = child[i]:findFirstChild("Head")
				if check ~= nil then
					if (check.Position - pos).magnitude < dist then
						torso = check
						dist = (check.Position - pos).magnitude
					end
				end
			end
		end
	end
	return torso
end

game:GetService("RunService").Stepped:Connect(function()
	local torso = findTorso(script.Parent.Position)
	if torso ~= nil then
		script.Parent.CFrame = CFrame.new(script.Parent.Position, torso.Position)
	end
end)
