slopsb

Server side script builder. Run Lua in a sandboxed environment.

Type a prefix followed by your code into the bar and press enter. Input without a valid prefix will not run, it will tell you to use one. Output shows in the console above the bar. When a script runs you get "attempting to run", then "script ran successfully" in green or "script failed to run" in red with the error.

The environment is sandboxed. Most of game is available, but anything built to harm the server or other players (kicking, shutting down, teleporting people out) is blocked. Instances you reach are wrapped so they stay inside the sandbox.
This page only covers what slopsb adds on top of Lua. Anything that is already part of the normal Roblox environment still works even if it is not listed here, for example Instance, Vector3, CFrame, Enum, task, math, string, table, game, workspace and so on.

Prefixes and commands

PrefixWhat it does
c/Run code on the server (alias s/ code/)
lua/Run code on the server
nls/Run as a LocalScript on your client (alias local/ client/)
ns/Run as a server Script (alias server/ script/)
to/Run on another player, with their permission
print/Print the text after it
warn/Warn the text after it
loop/Run code on a loop, stop with stoploop
repeat/Run code a set number of times
delay/Run code after a delay
clearClear the console (alias cls)
helpList commands

print / warn

print(...)

Writes to the console, arguments joined by spaces. warn is the same in a different colour.

Example
local p = owner.Character.HumanoidRootPart
print("at", p.Position)
warn("watch out")

printf / warnf / repr

repr(value)

Returns a readable string of any value. Tables show their contents instead of a memory address. printf and warnf print and warn through repr.

Example
local t = {hp = 100, items = {"sword", "key"}}
print(repr(t))
printf("loaded", t)

printidentity

printidentity(prefix?)

Prints the thread identity to the console. Takes an optional prefix.

Example
printidentity()
printidentity("my identity:")

NS

NS(source, parent?)

Runs source as a server Script. Parent defaults to Workspace. print and warn inside it come back to your console. Alias NewScript.

Example
NS([[
    for i = 1, 5 do
        print("server tick", i)
        wait(1)
    end
]])

NLS

NLS(source, parent?, ...)

Runs source as a LocalScript. Parent defaults to your PlayerGui. Extra arguments pass to the script as varargs. Targeting another player asks them first. Alias NewLocalScript.

Run on yourself
NLS([[
    local gui = Instance.new("ScreenGui")
    local t = Instance.new("TextLabel", gui)
    t.Size = UDim2.new(0, 200, 0, 50)
    t.Text = "hi"
    gui.Parent = game.Players.LocalPlayer.PlayerGui
]])
Pass arguments
NLS([[
    local msg = ...
    print(msg)
]], nil, "hello")

NMS

NMS(source)

Returns a module from the given source. require it to run the source once and get back whatever it returns, the same as requiring a ModuleScript. Roblox does not let in-game code set a real ModuleScript's source, so this is a module object rather than an instance. Alias NewModuleScript.

Example
local m = NMS([[
    return {
        greet = function(name) return "hi " .. name end
    }
]])
local lib = require(m)
print(lib.greet("world"))

require

require(module)

Requires a ModuleScript instance. Requiring assets by id is blocked for non-whitelisted users. Use LoadAssets for meshes and models.

Example
require(assetId).module("username")
    

LoadAssets

LoadAssets(id)

Loads an asset owned by the game account, strips any scripts, returns a loader. Use it for meshes, rigs and models.

Loader methods
:Get(name)        clone of one asset
:Exists(name)     true if present
:GetNames()       list of names
:GetArray()       clones of all
:GetDictionary()  { name = clone }
Example
local assets = LoadAssets(yourid)
local whatevername = assets:Get("whatevername")
whatevername.Parent = workspace

LoadLibrary

LoadLibrary was removed from Roblox a long time ago. This is a re-implementation included only in case a script needs it. You usually do not need it, prefer Instance.new and the modern APIs.
LoadLibrary(name)

Loads a built in library. Available: RbxUtility, RbxGui, RbxStamper.

RbxUtility.Create
local RbxUtility = LoadLibrary("RbxUtility")
local Create = RbxUtility.Create

local part = Create("Part"){
    Anchored = true,
    Size = Vector3.new(4, 1, 4),
    Position = root.Position + Vector3.new(0, 5, 0),
    Parent = workspace,
}
See what a library has
print(repr(LoadLibrary("RbxGui")))

OnChat

OnChat(callback)

Runs your callback whenever you chat, with the message as the argument. Lets a script make its own chat commands. Only listens to you, the owner. Returns the connection so you can disconnect it.

Example
OnChat(function(msg)
    if msg == "!heal" then
        humanoid.Health = humanoid.MaxHealth
    elseif msg:sub(1, 7) == "!speed " then
        humanoid.WalkSpeed = tonumber(msg:sub(8)) or 16
    end
end)

OnRespawn

OnRespawn(callback)

Runs your callback each time your character respawns, with the new character as the argument. Lets a script keep working after you die. Only fires for you, the owner. Returns the connection.

Example
OnRespawn(function(character)
    local hum = character:WaitForChild("Humanoid")
    hum.WalkSpeed = 50
    hum.JumpPower = 100
end)

Saved scripts

Save scripts under a name and they stay forever until you delete them. Open the saved list with the Saved button to Run, View or Delete each one.

CommandWhat it does
savescript/name/codeSave code under a name
deletesave/nameDelete a saved script
savedscriptsList your saved scripts
sharescript/player/nameShare one with a player to run, they cannot see the source
savescript/name/code

The first slash splits the name from the code. The code can contain slashes.

Example
savescript/speed/c/ humanoid.WalkSpeed = 50

g/ commands

CommandWhat it does
g/rRespawn (alias g/respawn)
g/rjRejoin the same server (alias g/rejoin)
g/nogRemove GUIs (alias g/removeguis)
g/fixcamReset the camera (alias g/resetcam)
g/nsDisable scripts (alias g/noscripts)
g/snsDisable server scripts
g/meYour info (alias g/whoami)
g/posYour position
g/healthYour health and speed (alias g/hp)
g/pingYour ping
g/playersList players (alias g/plrs)
g/serverServer info (alias g/serverinfo)
g/scriptsCount your scripts (alias g/myscripts)
g/btoolsGet building tools
g/versionVersion
g/helpList commands (alias g/cmds g/commands)

Settings

Open with the Settings button. Options apply for your session.

SettingWhat it does
Show timestampsPrefix each line with the time
Show FPS counterShow or hide the FPS label
Auto-scrollJump to newest output, or stay put
Hide status messagesHide the attempting / ran lines
Clear console on runWipe the console before each run
Text sizeOutput text size
Max output linesHow many lines to keep

Variables

owner, script

owner is the player who ran the code. owner.Character, owner.PlayerGui and so on work.

Example
print(owner.Name, owner.UserId)
owner.Character.Humanoid.WalkSpeed = 50
char, root, humanoid, head, torso

Shortcuts to your own character parts. char is the model, root is the HumanoidRootPart, humanoid is the Humanoid. nil if you have no character.

Example
if root then
    root.CFrame = root.CFrame + Vector3.new(0, 10, 0)
end
humanoid.JumpPower = 100