So this script makes a Part and then finds all other parts inside said Part then locates the Humanoids, I plan to make it so the localplayer's humanoid is ignored, but the For i, v in pairs loop doesn't even work idek why.

	Player = game:GetService("Players").LocalPlayer
	Mouse = Player:GetMouse()

	Mouse.Button1Down:Connect(function()
		if Player.Character then
			local Part = Instance.new("Part", Player.Character)
			Part.Anchored = true
			Part.CanCollide = false
			Part.Size = Vector3.new(25, 25, 25)
			Part.CFrame = Player.Character.Head.CFrame
			print("Part Created")
			for i, v in pairs(Part:GetTouchingParts()) do
				print("Loop Started")
				local IfHumanoid = v.Parent:FindFirstChild("Humanoid")
				if IfHumanoid ~= nil then
					print("Found Humanoid")
				end
			end
		end
	end)	

It Doesn't print "Loop Started" in the output

5 comments

0

I feel like its a stupid mistake

0

does it print part created

0

yes

0

that means there are no touching parts