So basically I have a pastebin url that I am using to retrieve a source. I am getting the paste using http requests and it works fine. How would I get that whole paste to be converted over to my scripts source? Pastebin URL contents:
function testFunc(param1)
print(param1 .. "HTTP REQUEST SUCCES")
end
How would I get this paste to “appear” in my source code so I can call the functions?
You will need a plugin to do this, first off, since only plugins and command bar can access it, but this doesn’t really seem appropriate for command bar so we’ll leave that one.
You would just do something like
local source = HttpService:GetAsync("https://pastebin.com/raw/EPVyj58n")
then get a script or create a new one then do
some_script.Source ..= "\n\n" .. source
This will just append 2 newlines then the source of the function, so it is readable. But do you really need this ? Can’t you maybe use a module and require by its ID instead?
What I meant to say was that I just want to be able to call the functions from the retrieved source. Is there any way I can do this without resorting to plugins? Also what do you mean by using modules?
Then you have no other way other than plugins, you won’t be able to tack on the source of a script at runtime (it doesn’t make sense either – the script will have been compiled already)
It worked slightly however in my function it prints out the parameter and when I call the function it doesn’t print anything. The function is defined though.