Here's the first way:
- I have 10 parts called "KillBrick" they're put all around the workspace.
- Each of them have this script inside:
local part = script.Parent
part.Touched:connect(function(toc)
if not toc.Parent and toc.Parent:FindFirstChild('Humanoid') then return end
local hum = toc.Parent.Humanoid
hum.Health = 0
end)
Here's the second way:
- I have 10 parts called "KillBrick" they're put inside a folder named "KillBricks" in the workspace.
- Inside the folder also have just 1 script:
local folder = script.Parent
for i,part in pairs(folder:GetChildren()) do
if part.Name == "KillBrick" then
part.Touched:connect(function(toc)
if not toc.Parent and toc.Parent:FindFirstChild('Humanoid') then return end
local hum = toc.Parent.Humanoid
hum.Health = 0
end)
end
end
So which one of the ways above is the best in improving performance? Both gameplay and server's response speed.

4 comments
The second way; looking through and connecting the event.
If you have any other suggestion or a better way to do it. Answer by taking one of the scripts above and improve it.
@TheeDeathCaster Can you explain how it will resolve the server's reponse speed faster than the first one?
Think of it similar to this: https://blog.roblox.com/2012/05/using-wait-wisely/