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

How do i change a script's source via another script?

Asked by 6 years ago

I want to make a plugin that creates scripts based on blocks,but i don't know how to change the source of a script. Can someone help me?

0
You can create a pastebin using their APIs, set the source of the script to the raw text of the link, and then delete the paste. hiimgoodpack 2009 — 6y
0
But my plugin isn't suposed to get sources online,it was supossed to CREATE sources arthurgps2 67 — 6y
0
No, use an API to create a paste with all the text you want to put in the script, not get a pre existing one. hiimgoodpack 2009 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

To change the source of a script is only possible when using plugins. Here's an example.

local NewScript = Instance.new("Script",workspace)
NewScript.Source = [[
    print("This is my script!")
]] --changing the source
print(NewScript.Source) --printing the source (getting the source)

Please accept my answer if this helped!

0
THANK YOU SO MUSH O.O arthurgps2 67 — 6y
0
Oops, messed up line 1. Just fixed it. PyccknnXakep 1225 — 6y
Ad

Answer this question