Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Can someone tell me the name of the thing I'm looking for?

Asked by 5 years ago

I know there’s a way to do this, I just forgot the name of it. How can I have multiple duplicates of a script but change one and it changes all of the duplicates?

For example, if I had a kill script and 50 kill bricks with 50 different kill scripts. (I know I could just use 1 script for it, but say I needed to use all 50 scripts) How would I change 1 script and it changes the rest

3 answers

Log in to vote
2
Answered by 5 years ago
1for _,v in pairs(PlacewhereScriptsAre:GetChildren()) do
2    v:Destroy()
3end
4for i = 1, HowManyScriptsYouWant do
5    local Script = script:Clone()
6    Script.Parent = PlacewhereScriptsAre
7end
8--there might be an easier way but idk it
Ad
Log in to vote
1
Answered by
Fad99 286 Moderation Voter
5 years ago

Its called a Linked Source to make a linked source make sure your game is published
Next make the script you want

then right click it and save as a linked source

name the source

now it is an asset under the scripts section in your game explorer

now you can have multiple scripts, but have one script edit all of them

0
the images are broken :( Fad99 286 — 5y
Log in to vote
0
Answered by 5 years ago

You can use Module script for functions that you’ll use in multiple scripts

Answer this question