kill a command bar script roblox studio ------------------------------------------------------------------------------------------------------------------------------------- -- @CloneTrooper1019, 2015-2016 -- CoreScript Command Bar -- Allows you to use members that are normally locked down to RobloxScriptSecurity (ROBLOX STUDIO ONLY) -- Will probably get patched at some point, do not abuse :< -- INSTALLATION: -- Go to the file directory for Roblox Studio -- Open content/scripts/StarterScript.lua -- Paste the contents of this script into there. -- (Protip: Use my Roblox Studio Mod Manager and you won't have to worry about updating this everytime Roblox Studio updates: kill a command bar script roblox studio PasteShr kill a command bar script roblox studio -- https://github.com/CloneTrooper1019/Roblox-Studio-Mod-Manager) -- CONTROLS: -- Press the ~ key to toggle the command bar -- Scroll up and down on the command bar to scroll through your history of command executions (current session only) -- Handy resource: -- http://wiki.roblox.com/index.php?title=Hidden_Members#RobloxScriptSecurity ------------------------------------------------------------------------------------------------------------------------------------- kill a command bar script roblox studio How to get it for free? kill a command bar script roblox studio -- Preload Default StarterScript -- (just to make sure we aren't behind or anything) ------------------------------------------------------------------------------------------------------------------------------------- local http = game:GetService("HttpService") local enabledState = http.HttpEnabled http.HttpEnabled = true local starterScript = http:GetAsync("https://raw.githubusercontent.com/ROBLOX/Core-Scripts/master/CoreScriptsRoot/StarterScript.lua") kill a command bar script roblox studio PasteShr kill a command bar script roblox studio http.HttpEnabled = enabledState -- The github repository may not be the version that is actually on production. -- Because of this, it may attempt to load CoreScripts that don't actually exist. -- To fix this, I'm just wrapping all invokes of that function into a pcall. starterScript = [[local function pspawn(func,...) local b = Instance.new("BindableEvent") b.Event:connect(function (...) pcall(func,...) kill a command bar script roblox studio How to use it? kill a command bar script roblox studio end) b:Fire(...) end ]]..starterScript:gsub("scriptContext:AddCoreScriptLocal%(","pspawn(scriptContext.AddCoreScriptLocal,scriptContext,") loadstring(starterScript)() ------------------------------------------------------------------------------------------------------------------------------------- -- Setup kill a command bar script roblox studio PasteShr kill a command bar script roblox studio ------------------------------------------------------------------------------------------------------------------------------------- local coreGui = game:GetService("CoreGui") local robloxGui = coreGui:WaitForChild("RobloxGui") local userInput = game:GetService("UserInputService") local guiService = game:GetService("GuiService") local rs = game:GetService("RunService") local history = {} spawn(function () kill a command bar script roblox studio How to use it? kill a command bar script roblox studio local controlFrame = robloxGui:WaitForChild("ControlFrame",5) if controlFrame then local toggleDevConsole = Instance.new("BindableFunction") toggleDevConsole.Name = "ToggleDevConsole" toggleDevConsole.Parent = controlFrame end end) local cmd = Instance.new("TextBox",robloxGui) cmd.Name = "Cmd" kill a command bar script roblox studio How to get it? kill a command bar script roblox studio cmd.Size = UDim2.new(1,0,0,29) cmd.Position = UDim2.new(0,0,1,0) cmd.TextXAlignment = "Left" cmd.FontSize = Enum.FontSize.Size28 cmd.Font = "SourceSans" cmd.Text = "" ------------------------------------------------------------------------------------------------------------------------------------- -- Input and Tweening ------------------------------------------------------------------------------------------------------------------------------------- kill a command bar script roblox studio PasteShr kill a command bar script roblox studio local inset = 0 local goalInset = 0 local isActive = false local function moveTowards(value,goal,rate) if value < goal then return math.min(goal,value + rate) elseif value > goal then return math.max(goal,value - rate) kill a command bar script roblox studio How to get it? kill a command bar script roblox studio else return goal end end local function renderUpdate() if inset ~= goalInset then local yOffset = 0 if robloxGui:FindFirstChild("TopBarContainer") then yOffset = robloxGui.TopBarContainer.Size.Y.Offset kill a command bar script roblox studio PasteShr kill a command bar script roblox studio end inset = moveTowards(inset,goalInset,6) guiService:SetGlobalGuiInset(0,yOffset,0,inset) end end local function setActive(active) isActive = active if isActive then goalInset = 30 kill a command bar script roblox studio How to dowload it? kill a command bar script roblox studio cmd:CaptureFocus() else goalInset = 0 cmd:ReleaseFocus() cmd.Text = "" end end local function onInputBegan(input) if input.KeyCode == Enum.KeyCode.Backquote then kill a command bar script roblox studio How to use it? kill a command bar script roblox studio setActive(not isActive) end end spawn(function () local topBar = robloxGui:WaitForChild("TopBarContainer",5) if topBar then inset = inset - 1 -- bump the inset end end) kill a command bar script roblox studio How to dowload it? kill a command bar script roblox studio rs:BindToRenderStep(http:GenerateGUID(),0,renderUpdate) userInput.InputBegan:connect(onInputBegan) ------------------------------------------------------------------------------------------------------------------------------------- -- Syntax Highlighting ------------------------------------------------------------------------------------------------------------------------------------- local primitivesRaw = "and break do else elseif end false for function if in local nil not or repeat return then true until while" local operators = "+ - * / %% ^ # = ~ < > %( %) { } %[ %] ; : , %." local env = getfenv() kill a command bar script roblox studio How to get it for free? kill a command bar script roblox studio local studio = settings().Studio local primitives = {} for primitive in primitivesRaw:gmatch("[^ ]+") do primitives[primitive] = true end local deprecatedBuiltInKeywords = { Game = true; kill a command bar script roblox studio How to use it? kill a command bar script roblox studio PluginManager = true; settings = true; Workspace = true; } local function isPrimitiveKeyword(keyword,s) return primitives[keyword] end local function isBuiltInKeyword(keyword) kill a command bar script roblox studio PasteShr kill a command bar script roblox studio return (env[keyword] ~= nil and rawget(env,keyword) == nil and not deprecatedBuiltInKeywords[keyword]) end local function indexGmatch(str,pattern) local indexAt = 1 return function () local startIndex,endIndex = str:find(pattern,indexAt) if startIndex and endIndex and startIndex <= endIndex then indexAt = endIndex + 1 return startIndex,endIndex,str:sub(startIndex,endIndex) kill a command bar script roblox studio PasteShr kill a command bar script roblox studio end end end -- Main -- local blankC3 = Color3.new() local function syntaxHighlight(str,fontSize) -- Update colors kill a command bar script roblox studio PasteShr kill a command bar script roblox studio local backgroundColor = studio["Background Color"] local builtInFunctionColor = studio["Built-in Function Color"] local commentColor = studio["Comment Color"] local keywordColor = studio["Keyword Color"] local numberColor = studio["Number Color"] local operatorColor = studio["Operator Color"] local stringColor = studio["String Color"] local textColor = studio["Text Color"] kill a command bar script roblox studio How to dowload it? kill a command bar script roblox studio cmd.BackgroundColor3 = backgroundColor cmd.BorderColor3 = blankC3:lerp(Color3.new(1-backgroundColor.r,1-backgroundColor.g,1-backgroundColor.b),0.4) cmd.TextColor3 = cmd.BorderColor3 -- Build the individual characters local fontHeight = tonumber(fontSize.Name:match("%d+$")) local charMap = {} local activeWidth = 0 kill a command bar script roblox studio How to dowload it? kill a command bar script roblox studio for _,v in pairs(cmd:GetChildren()) do if tonumber(v.Name) then v:Destroy() end end for char in str:gmatch(".") do local label = Instance.new("TextLabel",cmd) label.BackgroundTransparency = 1 kill a command bar script roblox studio PasteShr kill a command bar script roblox studio label.FontSize = fontSize label.Font = "SourceSans" label.Text = ((char == "\n" or char == "\t") and " " or char) label.TextColor3 = textColor label.ZIndex = 2 local bounds = label.TextBounds label.Size = UDim2.new(0,bounds.X,0,bounds.Y) label.Position = UDim2.new(0,activeWidth-1,0,1) activeWidth = activeWidth + bounds.X table.insert(charMap,{ kill a command bar script roblox studio How to get it? kill a command bar script roblox studio Character = char; Label = label; }) label.Name = #charMap end local function markCharMap(tag,color,startIndex,endIndex,setBold) for i = startIndex,endIndex do local char = charMap[i] char[tag] = true kill a command bar script roblox studio How to use it? kill a command bar script roblox studio char.Label.TextColor3 = color if setBold ~= nil then if setBold then char.Label.Font = "SourceSansBold" else char.Label.Font = "SourceSans" end end end end kill a command bar script roblox studio How to get it? kill a command bar script roblox studio -- Process Numbers for startIndex,endIndex in indexGmatch(str,"%d+") do local canMark = true if startIndex-1 > 0 then local charToLeft = str:sub(startIndex-1,startIndex-1) if charToLeft:match("%w") then canMark = false end kill a command bar script roblox studio PasteShr kill a command bar script roblox studio end if canMark then while endIndex < #str do local n = endIndex + 1 if str:sub(n,n):match("[%s%)%}%]]") then break else endIndex = n end end kill a command bar script roblox studio How to dowload it? kill a command bar script roblox studio markCharMap("Number",numberColor,startIndex,endIndex) end end -- Process built-in functions and primitives. for startIndex,endIndex,keyword in indexGmatch(str,"%w+") do if #keyword > 1 then if isPrimitiveKeyword(keyword) then markCharMap("Primitive",keywordColor,startIndex,endIndex,true) kill a command bar script roblox studio How to dowload it? kill a command bar script roblox studio elseif isBuiltInKeyword(keyword) then local canMark = true if startIndex-1 > 0 then local char = str:sub(startIndex-1,startIndex-1) if char == "." or char == ":" then canMark = false end end if canMark then markCharMap("BuiltIn",builtInFunctionColor,startIndex,endIndex,true) kill a command bar script roblox studio How to use it? kill a command bar script roblox studio end end end end -- Process basic strings local i = 1 local readingStr = false local activeChar = "" kill a command bar script roblox studio How to use it? kill a command bar script roblox studio while i <= #str do local char = str:sub(i,i) if char == '"' or char == "'" then markCharMap("String",stringColor,i,i,false) if not readingStr then readingStr = true activeChar = char elseif activeChar == char then readingStr = false kill a command bar script roblox studio How to use it? kill a command bar script roblox studio end end if readingStr then markCharMap("String",stringColor,i,i,false) if char == "\\" then -- Mark the next character as a string and skip it. -- Don't even ask questions. i = i + 1 if i <= #str then markCharMap("String",stringColor,i,i,false) kill a command bar script roblox studio How to get it for free? kill a command bar script roblox studio end elseif char == "\n" then -- Code execution will result in an error, but stop reading anyway. readingStr = false activeChar = "" end end i = i + 1 end kill a command bar script roblox studio PasteShr kill a command bar script roblox studio -- Process Blocks local i = 1 local startBlock = "" local inBlock = false while i <= #str do local char = str:sub(i,i) if char == "[" then local startedAt = i kill a command bar script roblox studio How to dowload it? kill a command bar script roblox studio local invalid = false startBlock = "[" while true do i = i + 1 if i > #str then break end local nextChar = str:sub(i,i) startBlock = startBlock .. nextChar if nextChar == "[" then kill a command bar script roblox studio How to dowload it? kill a command bar script roblox studio break elseif nextChar ~= "=" then invalid = true break end end if not invalid and #startBlock > 1 then local endBlock = startBlock:gsub("%[","%]") local endedAt = #str local ebStart,ebEnd = str:find(endBlock,startedAt) kill a command bar script roblox studio PasteShr kill a command bar script roblox studio if ebStart and ebEnd and ebStart < ebEnd then endedAt = ebEnd i = ebEnd end markCharMap("Block",stringColor,startedAt,endedAt,false) end end i = i + 1 end kill a command bar script roblox studio PasteShr kill a command bar script roblox studio -- Process Comments local inBlock = false for startIndex,endIndex,comment in indexGmatch(str,"%-%-") do if not charMap[startIndex].Block then while endIndex < #str do endIndex = endIndex + 1 local char = charMap[endIndex].Character if charMap[endIndex].Block then kill a command bar script roblox studio PasteShr kill a command bar script roblox studio inBlock = true elseif inBlock or char == "\n" then break end end markCharMap("Comment",commentColor,startIndex,endIndex,false) end end -- Process Operators kill a command bar script roblox studio How to dowload it? kill a command bar script roblox studio for operator in operators:gmatch("[^ ]+") do for startIndex,endIndex in indexGmatch(str,operator) do local m = charMap[startIndex] if not m.Comment and not m.Block and not m.String and not m.Number then markCharMap("Operator",operatorColor,startIndex,endIndex) end end end kill a command bar script roblox studio PasteShr kill a command bar script roblox studio lastCharTyped = tick() end local function onChanged(property) if property == "Text" or pcall(function () return studio[property] end) then syntaxHighlight(cmd.Text,cmd.FontSize) end end onChanged("Text") kill a command bar script roblox studio How to get it for free? kill a command bar script roblox studio cmd.Changed:connect(onChanged) studio.Changed:connect(onChanged) -------------------------------------------------------------------------------------------------------------------------------------- -- Command Execution -------------------------------------------------------------------------------------------------------------------------------------- local historyIndex = -1 local function onMouseWheelBackward() if isActive then kill a command bar script roblox studio How to get it? kill a command bar script roblox studio if historyIndex == -1 then historyIndex = 1 else historyIndex = math.min(#history,historyIndex+1) end if history[historyIndex] then cmd.Text = history[historyIndex] end end end kill a command bar script roblox studio PasteShr kill a command bar script roblox studio local function onMouseWheelForward() if isActive then if historyIndex == -1 then historyIndex = #history else historyIndex = math.max(1,historyIndex-1) end if history[historyIndex] then cmd.Text = history[historyIndex] kill a command bar script roblox studio PasteShr kill a command bar script roblox studio end end end local function onFocusLost(enterPressed) if enterPressed then historyIndex = -1 local text = cmd.Text if #text > 0 then table.insert(history,text) kill a command bar script roblox studio How to dowload it? kill a command bar script roblox studio warn(">",text) spawn(function () local func,errorMsg = loadstring(text) if func then func() else error("Error in script: "..errorMsg) end end) end kill a command bar script roblox studio How to use it? kill a command bar script roblox studio end if historyIndex == -1 then setActive(false) end end cmd.FocusLost:connect(onFocusLost) cmd.MouseWheelBackward:connect(onMouseWheelBackward) cmd.MouseWheelForward:connect(onMouseWheelForward) -------------------------------------------------------------------------------------------------------------------------------------- kill a command bar script roblox studio How to get it for free? kill a command bar script roblox studio kill a command bar script roblox studio