Advertisement
NoTextForSpeech

rconsole functions

Jun 9th, 2024
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.88 KB | None | 0 0
  1. local FullScreen = false
  2. getgenv().IsRConsoleAvaiable = false
  3.  
  4. -- Instances
  5. -- StarterGui.RConsole
  6. local RConsoleLib = {};
  7.  
  8. -- StarterGui.RConsole
  9. RConsoleLib["GUI"] = Instance.new("ScreenGui", game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui"));
  10. RConsoleLib["GUI"]["Name"] = [[RConsole]];
  11. RConsoleLib["GUI"]["ZIndexBehavior"] = Enum.ZIndexBehavior.Sibling;
  12. RConsoleLib["GUI"].Enabled = false;
  13.  
  14. -- StarterGui.RConsole.Main
  15. RConsoleLib["Main"] = Instance.new("Frame", RConsoleLib["GUI"]);
  16. RConsoleLib["Main"]["BackgroundColor3"] = Color3.fromRGB(255, 255, 255);
  17. RConsoleLib["Main"]["BackgroundTransparency"] = 1;
  18. RConsoleLib["Main"]["Size"] = UDim2.new(0.6713750958442688, 0, 0.8453856706619263, 0);
  19. RConsoleLib["Main"]["Position"] = UDim2.new(0.07658271491527557, 0, 0.09814050048589706, 0);
  20. RConsoleLib["Main"]["Name"] = [[Main]];
  21. RConsoleLib["Main"].Draggable = true;
  22. RConsoleLib["Main"].Active = true;
  23.  
  24. -- StarterGui.RConsole.Main.Bar
  25. RConsoleLib["Bar"] = Instance.new("Frame", RConsoleLib["Main"]);
  26. RConsoleLib["Bar"]["BackgroundColor3"] = Color3.fromRGB(239, 239, 239);
  27. RConsoleLib["Bar"]["AnchorPoint"] = Vector2.new(0.5, 0.5);
  28. RConsoleLib["Bar"]["BackgroundTransparency"] = 0.05000000074505806;
  29. RConsoleLib["Bar"]["Size"] = UDim2.new(1.004374384880066, 0, 0.08579881489276886, 0);
  30. RConsoleLib["Bar"]["BorderColor3"] = Color3.fromRGB(239, 239, 239);
  31. RConsoleLib["Bar"]["Position"] = UDim2.new(0.4338410794734955, 0, -0.009043283760547638, 0);
  32. RConsoleLib["Bar"]["Name"] = [[Bar]];
  33.  
  34. -- StarterGui.RConsole.Main.Bar.Icon
  35. RConsoleLib["Icon"] = Instance.new("ImageLabel", RConsoleLib["Bar"]);
  36. RConsoleLib["Icon"]["ScaleType"] = Enum.ScaleType.Fit;
  37. RConsoleLib["Icon"]["BackgroundColor3"] = Color3.fromRGB(255, 255, 255);
  38. RConsoleLib["Icon"]["Image"] = [[rbxassetid://13180865439]];
  39. RConsoleLib["Icon"]["Size"] = UDim2.new(0.03659530356526375, 0, 0.6883910894393921, 0);
  40. RConsoleLib["Icon"]["Name"] = [[Icon]];
  41. RConsoleLib["Icon"]["BackgroundTransparency"] = 1;
  42. RConsoleLib["Icon"]["Position"] = UDim2.new(0.007571442052721977, 0, 0.1424257457256317, 0);
  43.  
  44. -- StarterGui.RConsole.Main.Bar.Title
  45. RConsoleLib["Title"] = Instance.new("TextLabel", RConsoleLib["Bar"]);
  46. RConsoleLib["Title"]["TextWrapped"] = true;
  47. RConsoleLib["Title"]["TextScaled"] = true;
  48. RConsoleLib["Title"]["BackgroundColor3"] = Color3.fromRGB(255, 255, 255);
  49. RConsoleLib["Title"]["TextXAlignment"] = Enum.TextXAlignment.Left;
  50. RConsoleLib["Title"]["FontFace"] = Font.new([[rbxasset://fonts/families/Roboto.json]], Enum.FontWeight.Regular, Enum.FontStyle.Normal);
  51. RConsoleLib["Title"]["TextSize"] = 14;
  52. RConsoleLib["Title"]["TextColor3"] = Color3.fromRGB(0, 0, 0);
  53. RConsoleLib["Title"]["Size"] = UDim2.new(0.7172535061836243, 0, 0.4007798135280609, 0);
  54. RConsoleLib["Title"]["Text"] = identifyexecutor().." Console";
  55. RConsoleLib["Title"]["Name"] = [[Title]];
  56. RConsoleLib["Title"]["BackgroundTransparency"] = 1;
  57. RConsoleLib["Title"]["Position"] = UDim2.new(0.05776066333055496, 0, 0.27626264095306396, 0);
  58.  
  59. -- StarterGui.RConsole.Main.Bar.Close
  60. RConsoleLib["X"] = Instance.new("TextButton", RConsoleLib["Bar"]);
  61. RConsoleLib["X"]["TextWrapped"] = true;
  62. RConsoleLib["X"]["AutoButtonColor"] = false;
  63. RConsoleLib["X"]["TextScaled"] = true;
  64. RConsoleLib["X"]["BackgroundColor3"] = Color3.fromRGB(239, 239, 239);
  65. RConsoleLib["X"]["TextSize"] = 26;
  66. RConsoleLib["X"]["FontFace"] = Font.new([[rbxasset://fonts/families/FredokaOne.json]], Enum.FontWeight.Regular, Enum.FontStyle.Normal);
  67. RConsoleLib["X"]["TextColor3"] = Color3.fromRGB(0, 0, 0);
  68. RConsoleLib["X"]["Size"] = UDim2.new(0.09842874854803085, 0, 0.9257673025131226, 0);
  69. RConsoleLib["X"]["Name"] = [[Close]];
  70. RConsoleLib["X"]["BorderColor3"] = Color3.fromRGB(239, 239, 239);
  71. RConsoleLib["X"]["Text"] = [[X]];
  72. RConsoleLib["X"]["Position"] = UDim2.new(0.8984777927398682, 0, 0, 0);
  73. RConsoleLib["X"]["BackgroundTransparency"] = 0.05000000074505806;
  74.  
  75. -- StarterGui.RConsole.Main.Bar.Close.UITextSizeConstraint
  76. RConsoleLib["7"] = Instance.new("UITextSizeConstraint", RConsoleLib["X"]);
  77. RConsoleLib["7"]["MaxTextSize"] = 26;
  78.  
  79. -- StarterGui.RConsole.Main.Bar.Maximize
  80. RConsoleLib["Maximize"] = Instance.new("TextButton", RConsoleLib["Bar"]);
  81. RConsoleLib["Maximize"]["TextWrapped"] = true;
  82. RConsoleLib["Maximize"]["RichText"] = true;
  83. RConsoleLib["Maximize"]["AutoButtonColor"] = false;
  84. RConsoleLib["Maximize"]["TextScaled"] = true;
  85. RConsoleLib["Maximize"]["BackgroundColor3"] = Color3.fromRGB(239, 239, 239);
  86. RConsoleLib["Maximize"]["TextSize"] = 26;
  87. RConsoleLib["Maximize"]["FontFace"] = Font.new([[rbxasset://fonts/families/FredokaOne.json]], Enum.FontWeight.Bold, Enum.FontStyle.Normal);
  88. RConsoleLib["Maximize"]["TextColor3"] = Color3.fromRGB(0, 0, 0);
  89. RConsoleLib["Maximize"]["Size"] = UDim2.new(0.09842874854803085, 0, 0.9257673025131226, 0);
  90. RConsoleLib["Maximize"]["Name"] = [[Maximize]];
  91. RConsoleLib["Maximize"]["BorderColor3"] = Color3.fromRGB(239, 239, 239);
  92. RConsoleLib["Maximize"]["Text"] = [[□]];
  93. RConsoleLib["Maximize"]["Position"] = UDim2.new(0.800000011920929, 0, 0, 0);
  94. RConsoleLib["Maximize"]["BackgroundTransparency"] = 0.05000000074505806;
  95.  
  96. -- StarterGui.RConsole.Main.Bar.Maximize.UITextSizeConstraint
  97. RConsoleLib["9"] = Instance.new("UITextSizeConstraint", RConsoleLib["Maximize"]);
  98. RConsoleLib["9"]["MaxTextSize"] = 26;
  99.  
  100. -- StarterGui.RConsole.Main.Bar.Minimize
  101. RConsoleLib["Minimize"] = Instance.new("TextButton", RConsoleLib["Bar"]);
  102. RConsoleLib["Minimize"]["TextWrapped"] = true;
  103. RConsoleLib["Minimize"]["AutoButtonColor"] = false;
  104. RConsoleLib["Minimize"]["TextScaled"] = true;
  105. RConsoleLib["Minimize"]["BackgroundColor3"] = Color3.fromRGB(239, 239, 239);
  106. RConsoleLib["Minimize"]["TextSize"] = 26;
  107. RConsoleLib["Minimize"]["FontFace"] = Font.new([[rbxasset://fonts/families/FredokaOne.json]], Enum.FontWeight.Regular, Enum.FontStyle.Normal);
  108. RConsoleLib["Minimize"]["TextColor3"] = Color3.fromRGB(0, 0, 0);
  109. RConsoleLib["Minimize"]["Size"] = UDim2.new(0.09842874854803085, 0, 0.9257673025131226, 0);
  110. RConsoleLib["Minimize"]["Name"] = [[Minimize]];
  111. RConsoleLib["Minimize"]["BorderColor3"] = Color3.fromRGB(239, 239, 239);
  112. RConsoleLib["Minimize"]["Text"] = [[-]];
  113. RConsoleLib["Minimize"]["Position"] = UDim2.new(0.7015712857246399, 0, 0, 0);
  114. RConsoleLib["Minimize"]["BackgroundTransparency"] = 0.05000000074505806;
  115.  
  116. -- StarterGui.RConsole.Main.Bar.Minimize.UITextSizeConstraint
  117. RConsoleLib["b"] = Instance.new("UITextSizeConstraint", RConsoleLib["Minimize"]);
  118. RConsoleLib["b"]["MaxTextSize"] = 26;
  119.  
  120. -- StarterGui.RConsole.Main.CmdPrompt
  121. RConsoleLib["CmdPrompt"] = Instance.new("ScrollingFrame", RConsoleLib["Main"]);
  122. RConsoleLib["CmdPrompt"]["Active"] = true;
  123. RConsoleLib["CmdPrompt"]["MidImage"] = [[http://www.roblox.com/asset/?id=5234388158]];
  124. RConsoleLib["CmdPrompt"]["TopImage"] = [[]];
  125. RConsoleLib["CmdPrompt"]["BackgroundColor3"] = Color3.fromRGB(0, 0, 0);
  126. RConsoleLib["CmdPrompt"]["AnchorPoint"] = Vector2.new(0.5, 0.5);
  127. RConsoleLib["CmdPrompt"]["AutomaticCanvasSize"] = Enum.AutomaticSize.Y;
  128. RConsoleLib["CmdPrompt"]["BackgroundTransparency"] = 0.05000000074505806;
  129. RConsoleLib["CmdPrompt"]["Size"] = UDim2.new(1.004374384880066, 0, 0.9151874780654907, 0);
  130. RConsoleLib["CmdPrompt"]["ScrollBarImageColor3"] = Color3.fromRGB(191, 191, 191);
  131. RConsoleLib["CmdPrompt"]["BorderColor3"] = Color3.fromRGB(0, 0, 0);
  132. RConsoleLib["CmdPrompt"]["ScrollBarThickness"] = 15;
  133. RConsoleLib["CmdPrompt"]["Position"] = UDim2.new(0.4338410794734955, 0, 0.4932645559310913, 0);
  134. RConsoleLib["CmdPrompt"]["Name"] = [[CmdPrompt]];
  135. RConsoleLib["CmdPrompt"]["BottomImage"] = [[]];
  136.  
  137. -- StarterGui.RConsole.Main.CmdPrompt.UIListLayout
  138. RConsoleLib["d"] = Instance.new("UIListLayout", RConsoleLib["CmdPrompt"]);
  139. RConsoleLib["d"]["SortOrder"] = Enum.SortOrder.LayoutOrder;
  140.  
  141. -- StarterGui.RConsole.Main.Saves
  142. RConsoleLib["Folder"] = Instance.new("Folder", RConsoleLib["Main"]);
  143. RConsoleLib["Folder"]["Name"] = [[Saves]];
  144.  
  145. -- StarterGui.RConsole.Main.Saves.TextLineInput
  146. RConsoleLib["Input"] = Instance.new("TextBox", RConsoleLib["Folder"]);
  147. RConsoleLib["Input"]["TextSize"] = 14;
  148. RConsoleLib["Input"]["TextXAlignment"] = Enum.TextXAlignment.Left;
  149. RConsoleLib["Input"]["TextWrapped"] = true;
  150. RConsoleLib["Input"]["TextScaled"] = true;
  151. RConsoleLib["Input"]["BackgroundColor3"] = Color3.fromRGB(6, 6, 6);
  152. RConsoleLib["Input"]["TextColor3"] = Color3.fromRGB(255, 255, 255);
  153. RConsoleLib["Input"]["FontFace"] = Font.new([[rbxasset://fonts/families/Inconsolata.json]], Enum.FontWeight.Regular, Enum.FontStyle.Normal);
  154. RConsoleLib["Input"]["MultiLine"] = true;
  155. RConsoleLib["Input"]["Size"] = UDim2.new(0.9800000190734863, 0, 0, 18);
  156. RConsoleLib["Input"]["BorderColor3"] = Color3.fromRGB(6, 6, 6);
  157. RConsoleLib["Input"]["Text"] = [[_]];
  158. RConsoleLib["Input"]["Position"] = UDim2.new(-0.04964490607380867, 0, -0.009164969436824322, 0);
  159. RConsoleLib["Input"]["AutomaticSize"] = Enum.AutomaticSize.Y;
  160. RConsoleLib["Input"]["Visible"] = false;
  161. RConsoleLib["Input"]["Name"] = [[TextLineInput]];
  162. RConsoleLib["Input"]["ClearTextOnFocus"] = false;
  163.  
  164. -- StarterGui.RConsole.Main.Saves.TextLineInput.UITextSizeConstraint
  165. RConsoleLib["10"] = Instance.new("UITextSizeConstraint", RConsoleLib["Input"]);
  166. RConsoleLib["10"]["MaxTextSize"] = 17;
  167.  
  168. -- StarterGui.RConsole.Main.Saves.TextLineWarn
  169. RConsoleLib["Warn"] = Instance.new("TextLabel", RConsoleLib["Folder"]);
  170. RConsoleLib["Warn"]["TextWrapped"] = true;
  171. RConsoleLib["Warn"]["TextYAlignment"] = Enum.TextYAlignment.Top;
  172. RConsoleLib["Warn"]["TextScaled"] = true;
  173. RConsoleLib["Warn"]["BackgroundColor3"] = Color3.fromRGB(6, 6, 6);
  174. RConsoleLib["Warn"]["TextXAlignment"] = Enum.TextXAlignment.Left;
  175. RConsoleLib["Warn"]["FontFace"] = Font.new([[rbxasset://fonts/families/Inconsolata.json]], Enum.FontWeight.Regular, Enum.FontStyle.Normal);
  176. RConsoleLib["Warn"]["TextSize"] = 14;
  177. RConsoleLib["Warn"]["TextColor3"] = Color3.fromRGB(255, 255, 255);
  178. RConsoleLib["Warn"]["AutomaticSize"] = Enum.AutomaticSize.Y;
  179. RConsoleLib["Warn"]["Size"] = UDim2.new(0.9800000190734863, 0, 0, 18);
  180. RConsoleLib["Warn"]["BorderColor3"] = Color3.fromRGB(6, 6, 6);
  181. RConsoleLib["Warn"]["Text"] = [[[Warn] Hi]];
  182. RConsoleLib["Warn"]["Name"] = [[TextLineWarn]];
  183. RConsoleLib["Warn"]["Visible"] = false;
  184. RConsoleLib["Warn"]["Position"] = UDim2.new(-3.1526422361594086e-08, 0, 8.477105097881577e-07, 0);
  185.  
  186. -- StarterGui.RConsole.Main.Saves.TextLineWarn.UITextSizeConstraint
  187. RConsoleLib["12"] = Instance.new("UITextSizeConstraint", RConsoleLib["Warn"]);
  188. RConsoleLib["12"]["MaxTextSize"] = 17;
  189.  
  190. -- StarterGui.RConsole.Main.Saves.TextLinePrint
  191. RConsoleLib["Print"] = Instance.new("TextLabel", RConsoleLib["Folder"]);
  192. RConsoleLib["Print"]["TextWrapped"] = true;
  193. RConsoleLib["Print"]["TextYAlignment"] = Enum.TextYAlignment.Top;
  194. RConsoleLib["Print"]["TextScaled"] = true;
  195. RConsoleLib["Print"]["BackgroundColor3"] = Color3.fromRGB(6, 6, 6);
  196. RConsoleLib["Print"]["TextXAlignment"] = Enum.TextXAlignment.Left;
  197. RConsoleLib["Print"]["FontFace"] = Font.new([[rbxasset://fonts/families/Inconsolata.json]], Enum.FontWeight.Regular, Enum.FontStyle.Normal);
  198. RConsoleLib["Print"]["TextSize"] = 14;
  199. RConsoleLib["Print"]["TextColor3"] = Color3.fromRGB(255, 255, 255);
  200. RConsoleLib["Print"]["AutomaticSize"] = Enum.AutomaticSize.Y;
  201. RConsoleLib["Print"]["Size"] = UDim2.new(0.9800000190734863, 0, 0, 18);
  202. RConsoleLib["Print"]["BorderColor3"] = Color3.fromRGB(6, 6, 6);
  203. RConsoleLib["Print"]["Text"] = [[test]];
  204. RConsoleLib["Print"]["Name"] = [[TextLinePrint]];
  205. RConsoleLib["Print"]["Visible"] = false;
  206. RConsoleLib["Print"]["Position"] = UDim2.new(-3.1526422361594086e-08, 0, 8.477105097881577e-07, 0);
  207.  
  208. -- StarterGui.RConsole.Main.Saves.TextLinePrint.UITextSizeConstraint
  209. RConsoleLib["14"] = Instance.new("UITextSizeConstraint", RConsoleLib["Print"]);
  210. RConsoleLib["14"]["MaxTextSize"] = 17;
  211.  
  212. -- StarterGui.RConsole.Main.UIAspectRatioConstraint
  213. RConsoleLib["15"] = Instance.new("UIAspectRatioConstraint", RConsoleLib["Main"]);
  214. RConsoleLib["15"]["AspectRatio"] = 1.6069246530532837;
  215.  
  216. -- Functions
  217. -- Window
  218. local MinSized = nil
  219. local MinPos = nil
  220. local function HideConsole()
  221. RConsoleLib["GUI"].Enabled = false;
  222. end
  223. local function ShowConsole()
  224. RConsoleLib["GUI"].Enabled = true;
  225. end
  226.  
  227. local function MaximizeToggle()
  228. if not FullScreen then
  229. MinSized = RConsoleLib["Main"].Size
  230. MinPos = RConsoleLib["Main"].Position
  231. RConsoleLib.Main.Size = UDim2.new(1,0,1,0)
  232. RConsoleLib["Main"].Position = UDim2.new(0,0,0,0);
  233. FullScreen = true
  234. RConsoleLib["Main"].Draggable = false;
  235. RConsoleLib["15"]:Destroy()
  236. else
  237. RConsoleLib["Main"].Draggable = true;
  238. RConsoleLib["Main"]["Size"] = MinSized
  239. RConsoleLib["Main"]["Position"] = MinPos
  240. FullScreen = false
  241. RConsoleLib["15"] = Instance.new("UIAspectRatioConstraint", RConsoleLib["Main"]);
  242. RConsoleLib["15"]["AspectRatio"] = 1.6069246530532837;
  243. end
  244. end
  245.  
  246. local function CPrint(text, color)
  247. RConsoleLib["GUI"].Enabled = true;
  248. local frame = RConsoleLib["Print"]:Clone()
  249. frame.Visible = true
  250. frame.Parent = RConsoleLib["CmdPrompt"]
  251. frame.Text = text
  252. end
  253.  
  254. local function CWarn(text, color)
  255. RConsoleLib["GUI"].Enabled = true;
  256. local frame = RConsoleLib["Warn"]:Clone()
  257. frame.Visible = true
  258. frame.Parent = RConsoleLib["CmdPrompt"]
  259. frame.Text = "[⚠️] "..text
  260. end
  261. local function CInput(text, color)
  262. RConsoleLib["GUI"].Enabled = true;
  263. local frame = RConsoleLib["Input"]:Clone()
  264. frame.Visible = true
  265. frame.Text = ""
  266. frame.Parent = RConsoleLib["CmdPrompt"]
  267. task.spawn(function()
  268. while true do
  269. frame.PlaceholderText = "■"
  270. task.wait(1)
  271. frame.PlaceholderText = ""
  272. end
  273. end)
  274. frame:CaptureFocus()
  275. frame.FocusLost:wait()
  276.  
  277. local InputText = frame.Text
  278. frame.TextEditable = false
  279. return InputText
  280. end
  281. local function CClear()
  282. for i,v in pairs(RConsoleLib["CmdPrompt"]:GetChildren()) do
  283. if v:IsA("TextLabel") or v:IsA("TextBox") then
  284. v:Destroy()
  285. end
  286. end
  287. end
  288. local function SetTitleC(Title)
  289. RConsoleLib["GUI"].Enabled = true;
  290. RConsoleLib["Title"].Text = Title
  291. end
  292.  
  293. -- Run Functions
  294. RConsoleLib["Maximize"].MouseButton1Up:Connect(MaximizeToggle)
  295. RConsoleLib["X"].MouseButton1Up:Connect(HideConsole)
  296. RConsoleLib["Minimize"].MouseButton1Up:Connect(HideConsole)
  297.  
  298.  
  299. -- Set Environment
  300. getgenv().rconsoledestroy = HideConsole
  301. getgenv().rconsoleprint = CPrint
  302. getgenv().rconsolewarn = CWarn
  303. getgenv().rconsoleinput = CInput
  304. getgenv().rconsoleclear = CClear
  305. getgenv().rconsoledestroy = HideConsole
  306. getgenv().rconsolecreate = ShowConsole
  307. getgenv().rconsolesettitle = SetTitleC
  308.  
  309. getgenv().consoledestroy = HideConsole
  310. getgenv().consoleprint = CPrint
  311. getgenv().consolewarn = CWarn
  312. getgenv().consoleinput = CInput
  313. getgenv().consoleclear = CClear
  314. getgenv().consoledestroy = HideConsole
  315. getgenv().consolecreate = ShowConsole
  316. getgenv().consolesettitle = SetTitleC
  317.  
  318.  
  319.  
  320. -- End
  321. getgenv().IsRConsoleAvaiable = true
  322. return RConsoleLib["GUI"], require;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement