Updating multiple scripts with depreciated text

I am trying to update the text on several scripts at once. I have multiple doors across my map that are using the same script, they all have this issue. If I am unable to update them all I might just delete and replace new ones. image

2 Likes

Two things.

You can use the find plugin to lookup specific keywords in all your scripts.

Simply go to view at the top of studio, and enable the find plugin. Then search for the keywords you’re looking for.

Second. Place one script in repstorage, and in each of the doors, replace the script with a simple script, that clones the script in replicated storage to the location of the script that does the cloning. This way, you’ll only ever have to edit one script.

4 Likes

It can be a cumbersome task having to edit multiple scripts that do pretty much the same job. Instead of trying to update the text on several scripts, I suggest creating one master script that controls the behavior of all the doors in your map. That way, the changes you make to that script will affect the behavior of all the doors in the map.

2 Likes

Each door has a specific permission node (Card levels) The only way I can see working with this is to have a master script that dictates what happens when the keypad is touched with the keycard and just grab the permissions from a value on each door

1 Like

You could use a module script to store what happens for each door, and have the cloned script run a generic function that reads from the module, along with the value that’s stored with the door, or simply name the door as what the module script would need.

Red door. Blue door. Green door. Etc.

You’re welcome :slight_smile:

I’ll start working on a system like that, Thanks! :heart: :heart: :heart: :heart:

1 Like

It might be better in the future to try and use CollectionService: https://developer.roblox.com/en-us/api-reference/class/CollectionService

Basically, you can tag objects and then run a script that’ll run on all of them. That way, you don’t have to create an individual script for each and every single one of them and have the hassle of future debugging/issues.

Tutorial/example: https://www.youtube.com/watch?v=G2AATrTPpIg

(Implementing @XlxLiveLivelyxlX would also be easy in this case, some if statements would be needed of course)

2 Likes

Pretty sure something like this would work:

for _, luaSourceContainer in ipairs(x:GetDescendants()) do
    if luaSourceContainer:IsA("LuaSourceContainer") then
        luaSourceContainer.Source = luaSourceContainer.Source:gsub("Spawn", "spawn")
    end
end
2 Likes

Click view → open the very small “Find All / Replace All” button, then click on the double arrow pointing down, in the second line write what you want to replace everything with, and click replace all