The Script Hub
The built-in script library: how to search it, what the cards mean, and running scripts safely.
The hub sorts scripts by which game they're for. You can search three ways and combine them:
- By place ID: paste the number from a Roblox game link to get everything made for that game.
- By player count: sort by what's busy right now, which usually tells you which scripts are still maintained.
- By provider: only show one hub or author if there's one you trust.
Place ID is the reliable one
Game names clash and get changed. The number in roblox.com/games/<id>/... doesn't.
What it means
Whatever description the author wrote, usually a feature list.
Visit count
How popular the game is. A script for a dead game is usually a dead script.
Players now
Live count. Good for telling an active script from an abandoned one.
Run
Runs the script straight away without opening it in the editor.
Run works exactly like the editor's Execute button. Same environment, same globals, same console. If you want to read it first, open it in a tab and run it from there.
-- What "Run" is doing, roughly. You can do the same by hand
-- for any script you have a URL for.
local source = game:HttpGet("https://example.com/script.lua")
loadstring(source)()Hub scripts are other people's code
A hub script runs with your identity and full filesystem access. It can read your workspace folder and make HTTP requests. Read anything you didn't write, or at least stick to people you actually trust.
You don't have to use the hub at all. A lot of people end up with their own loader in autoexec/ that loads their scripts from disk or a URL depending on what game they joined.
-- autoexec/loader.lua
local BY_PLACE = {
[1234567890] = "scripts/game-a.lua",
[9876543210] = "scripts/game-b.lua",
}
local path = BY_PLACE[game.PlaceId]
if path and isfile(path) then
local chunk, err = loadstring(readfile(path), path)
if not chunk then
return warn("failed to compile " .. path .. ": " .. tostring(err))
end
local ok, runErr = pcall(chunk)
if not ok then
warn("failed to run " .. path .. ": " .. tostring(runErr))
end
end