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

How to created a script via existing script that already has coding written on it?

Asked by 6 years ago

I know how to create a script from a script [Instance.new('Script')] but how would I have it created with some codes onto already? What do I add in the existing script to make the newly generated script to have code?

2 answers

Log in to vote
0
Answered by 6 years ago

you can you the clone() function to duplicate an already-made script. Simply do something like this:

Script = (put the location of the script you want to clone/duplicate here!)

NewScript = Script:Clone()
NewScript.Parent = (wherever you want to parent it.)

0
Nah, I might as well just Ctrl+D that. seanzhu 1 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
local newScript = Instance.new("Script")
local localScript = Instance.new("LocalScript")
local moduleScript = Instance.new("ModuleScript")
0
Yeah, like I just can't go into Advance Objects and insert them. seanzhu 1 — 6y
0
You misunderstood the question. seanzhu 1 — 6y

Answer this question