Template:TagSSRbxScriptSource

-- Tag Lua Script System Roblox Computer Server Script -- Load RbxLibraries local RbxGui = assert(LoadLibrary('RbxGui')) local RbxUtility = assert(LoadLibrary('RbxUtility')) -- local RbxStatus = assert(LoadLibrary('RbxStatus')) local RbxGear = assert(LoadLibrary('RbxGear')) local RbxStamper = assert(LoadLibrary('RbxStamper')) -- Done Loading RbxLibraries, Wait for ComputerServer to finish setting up. while _G["ComputerServerReady"] == nil do  wait(1) end

local IsTerrainBuilder = _G["TerrainBuilderScript"] local MaxSavedData -- The max DPUnits used if IsTerrainBuilder == false then MaxSavedData = _G["MaxSavedData"] else MaxSavedData = _G["MaxSavedDataComputer"] end

-- make environment local env = {} -- add functions you know are safe here

-- run code under environment [Lua 5.1] local function run(untrusted_code) local untrusted_function, message = loadstring(untrusted_code) if not untrusted_function then return nil, message end setfenv(untrusted_function, env) return pcall(untrusted_function) end

-- test assert(not run print(debug.getinfo(1))) --> fails assert(run x=1) --> ok

--Setup the computer environment

_G.ComEnv = { }

_G.DefaultComInv = { } -- The Default Environment

local ComEnv = _G.ComEnv

-- New Computer Environment function NewComEnv(ComID) ComEnv["ComID"..ComID] = { } local NewComEnv = ComEnv["ComID"..ComID] NewComEnv.PrintServerOutput = print NewComEnv.TerrainBuilder = IsTerrainBuilder NewComEnv.ID = "ComID"..ComID NewComEnv.Server = _G.Server NewComEnv.assert = assert NewComEnv.error = error NewComEnv.ipairs = ipairs NewComEnv.pairs = pairs NewComEnv.pcall = pcall NewComEnv.select = select NewComEnv.coroutine = coroutine NewComEnv.string = string NewComEnv.table = table NewComEnv.math = math return NewComEnv end

--