Multiple GetTouchingParts

image

Ive got this so far. It isnt working. Any idea why? It constantly prints flying

Would you mind show the full code?

image

No, not like that. Please, pay attention to the template whenever you make a topic on the Developer Forum. Use 3 Ticks / ```, write your code, and then place 3 Ticks again:

--I am code!!!

(3 Ticks) --I am code!!! (3 Ticks)

			
			repeat wait()
				for _,v in ipairs(char:GetChildren()) do
					if v:IsA("BasePart") then
						for _,i in ipairs(v:GetTouchingParts()) do
							if i.Parent:FindFirstChild("Humanoid") == nil and i.Parent ~= workspace:FindFirstChild(game.Workspace.Effects) then
								pass = true
								print("hit")
						end
					end
					print("flying")
					

						
					end
				end
			until pass == true
			hum:TakeDamage(dmg)
			lol(dmg)
		end))```

Eh, I meant ALL the code in the script…

Theres WAAAAAAAY to much. Its a very very large script. And id rather not giveaway all the code in it

1 Like
while pass == false do
	for _, Child in ipairs(char:GetDescendants()) do
		if Child:IsA("BasePart") then
			print('Child of Character is a BodyPart.')
			
			for _, TouchingPart in ipairs(Child:GetTouchingParts()) do
				local Hum = TouchingPart.Parent:FindFirstChild('Humanoid')
				if Hum and TouchingPart.Parent ~= workspace:FindFirstChild('Effects') then
					pass = true
					print('Humanoid is not nil in TouchingPart.Parent.')
					Hum:TakeDamage(dmg)
					lol(dmg)
				end
			end
		end
	end
end