We don’t currently allow scripts to dynamically become Linked or to change the source they have (there are a few technical limitations that currently prevent this). The easiest way to get this kind of behavior is to have an instance of the linked script somewhere (e.g. ReplicatedStorage) and :Clone it.
Alternatively you can also create a model with the LinkedScript and insert it using insert service, but this feels more clunky.
We are discussing internally weather we can add an API to directly create instances of linked scripts, but we don’t have immediately plans to add this.
[quote] We don’t currently allow scripts to dynamically become Linked or to change the source they have (there are a few technical limitations that currently prevent this). The easiest way to get this kind of behavior is to have an instance of the linked script somewhere (e.g. ReplicatedStorage) and :Clone it.
Alternatively you can also create a model with the LinkedScript and insert it using insert service, but this feels more clunky.
We are discussing internally weather we can add an API to directly create instances of linked scripts, but we don’t have immediately plans to add this. [/quote]
Isn’t the whole purpose of LinkedSource to eliminate having to do that?
[quote] We don’t currently allow scripts to dynamically become Linked or to change the source they have (there are a few technical limitations that currently prevent this). The easiest way to get this kind of behavior is to have an instance of the linked script somewhere (e.g. ReplicatedStorage) and :Clone it.
Alternatively you can also create a model with the LinkedScript and insert it using insert service, but this feels more clunky.
We are discussing internally weather we can add an API to directly create instances of linked scripts, but we don’t have immediately plans to add this. [/quote]
Isn’t the whole purpose of LinkedSource to eliminate having to do that?[/quote]
Nah, I think its purpose is to stop redundant code.