I have a script that is in like 50 parts and I don’t want to edit each individual one to edit all of them. Is there a way I can edit all of those scripts at once?
If you mean to have all the scripts use the same scripts/functions, moduleScript is pretty useful for that.
1 Like
You can rewrite it so that one script applies to all the parts. That’s what I would recommend you do. You could make use of CollectionService. Doesn’t that sound a lot better than editing 50 different scripts?
This might not be the best solution, but maybe just have a Cloning script clone your script into all the 50 parts when the game starts. That way you can edit the script in studio and it will be cloned into all parts in game. Here is an example of the cloning script code:
-- Loops through all children of the part folder, and adds the script to them
for _, int in ipairs(script.Parent:GetChildren()) do
local Clone = script.ScriptToBeCloned:Clone()
Clone.Parent = int
wait(.01)
end
script:Destroy()
Here is the hierarchy i am using for this:
3 Likes
This worked great! Thank you so much.