Best way to make kill parts for obbies?

I use CollectionService to detect if a part is suppose to kill the player. Basically, you tag the parts that you want to be kill parts and you can detect if the part is tagged or not. This is good because I don’t have to put a kill script in every kill part.

I jujst want to know if there is a better way to make kill parts or I want to know what has worked better for you in the past.

You make a kill brick and copy-paste it. It’s as simple as that.

but then you have a bunch of kill bricks that each have a script which is inefficient

Unless your obby has thousands of kill bricks, I don’t see the issue.

well lets say that you do have a thousand, then what would you do

One way you could do it is make a folder containing all of the kill parts, and have one singular script in ServerScriptService that managed them all for the folder.
This has worked for me in the past.

for _, part in pairs(folder:GetChildren()) do
    part.Touched:Connect(function(hit)
        --kill code here
    end)
end
1 Like

you could just copy the script into each, however collectionservice is more efficient and I would suggest it, I’m guessing you’re using touched to detect when a character hits the part and I can’t see inserting a script into each being much more costly on performance

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