I want to kill the players with the name "Noob" when someone touches a brick but I don't know how to do that in my code
local noobs = workspace:GetChildren()
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
for i,v in pairs(noobs) do
if v.Name == "Noob" then
end
end
wait(0)
end
end
script.Parent.Touched:connect(onTouched)

2 comments
you don't have to define it inside...
If the game is dynamic and the number of Noobs changes, yes you do ;D