Maybe you could loop through every part in the Workspace, and calculate the time it takes for the nuke to reach it using the distance from ground zero and the speed of the explosion. So you only have to loop through all of the parts once.
I’ve got another idea: Store a list of each part’s distance from ground zero, and the part itself. Then, while the nuke is running, iterate through the list every frame. If the part is inside the expanding blast radius, then change its look and delete the part from the list.
I’ve tried this and it works well. I put an array of nine Crossroads and the Effiel Tower and in the beginning it runs at around 16 FPS, I think. Here is a video showing this: nuke.wmv (4.4 MB)
EDIT: i somehow forgot the post the code and then i closed the place with the code and it’s gone forever now
do this everytime you resize or as you are resizing
then iterate through them and do what you need to the parts
local Part = workspace.Nuke
for i, touched in ipairs(Part:GetTouchingParts()) do -- this will get table of parts it is touching and check if the material is set to corrod if not it sets it
if touched.Material ~= Enum.Material.CorrodedMetal then
touched.Material = Enum.Material.CorrodedMetal
if you are using a not collide part then you will need to setup a function with a temp connection to Part.Touched then call the gettouchingparts on the part
then diconnect it and send results back