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

1 Like
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
3 Likes

thanks it works, many thanks!!!

2 Likes

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