How Can I Get Scripts From A GitHub Repo?

Hello! I have seen this in some scripts that people get scripts from a Github Repo. I was wondering how I could do that.

https://github.com/Roblox/rodux/something.lua

The above will then create a folder somewhere and then a .Lua file in that folder called something will have code in it.
Example Code: print("DevForum Is Sickly Cool")

Is this possible? (Probably. I’ve Seen It In A Lot Of Models)

1 Like

You can use loadstring to do this, It must be enabled via ServerScriptService tho!

EDIT: Then you would do loadstring(“https://github.com/Roblox/rodux/something.lua”)

2 Likes

So then it will get the code from it?

Yes, it would get the code from it and then run the script.

Is there anyways for it to create instances of it though?

What do you mean by Instances?

1 Like

Like below:

Screen Shot 2020-05-10 at 2.38.20 pm

@HmmBilly
loadstring requires a string of valid Lua code. You need to make a GET request to https://github.com/Roblox/rodux/something.lua to get its contents.

local HttpService = game:GetService("HttpService")
local code = HttpService:GetAsync("https://github.com/Roblox/rodux/something.lua", true)
local f = loadstring(code)
f()

@Aiden_12114 no, but loadstring returns a function. You then call the function to execute the given code.

7 Likes

Ah my bad, Havnt used loadstring in a while. Im used to just requring the code.

1 Like

@sjr04 I saw that RoStrap get’s models from GitHub and imports them into Roblox Studio. So it must be possible, right?

(Such As Installing CmdR)

1 Like

How can I use this with an access token?