Why isnt my for loop killbrick not working (PROBABLY AN EASY FIX) (I Want it to be a for loop)


local KillBrick = workspace.KillBrick

for i,v in pairs(KillBrick) do
local humanoid = v.Parent:FindFirstChild(“Humanoid”)
if humanoid then
v.Parent.humanoid.Health = 0

end

end
image

local KillBrick = workspace.KillBrick
for i,v in KillBrick:GetChildren() do
	v.Touched:Connect(function(hit)
		local humanoid = hit.Parent:FindFirstChild("Humanoid")
		if humanoid then
			humanoid.Health = 0 
		end
	end)
end
1 Like

thanks it works, many thanks!!!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.