-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSTX Console V2.lua
322 lines (277 loc) · 13.1 KB
/
STX Console V2.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
-- https://pastebinp.com/raw/EFRype0R
-- Developed by Team STK
-- Created : 4/10/2022, 12:21 AM
--[[
Developers = {
["Owner"] + ["Scripter"] + ["Designer"] = "Luke" or Discord : "Luke Marcus#4347",
['Fixed Auto Scroll'] = "MintTea" or Discord: "MintTea#9260"
}
Color Palette = {
220, 220, 220 - Bright
100, 100, 100 - Grey
58, 58, 58 - Dark
}
]]
do
local Console = game:GetService("CoreGui"):FindFirstChild("STX_Console")
if Console then
Console:Destroy()
end
end
local Console = {}
local function pretty_date(date)
local dateString = "{year}-{month}-{day} {hour}:{min}"
local result = string.gsub(dateString, "{(%w+)}", date)
return result
end
local now = os.time()
function Console:Window(consoledebugger)
local Title = tostring(consoledebugger.Title)
local GuiPosition = consoledebugger.Position
local DragSpeed = consoledebugger.DragSpeed
local STX_Console = Instance.new("ScreenGui")
local ambientShadow = Instance.new("ImageLabel")
local Window = Instance.new("Frame")
local Outline_A = Instance.new("Frame")
local ConsoleContainer = Instance.new("ScrollingFrame")
local ConsoleContainerUIListLayout = Instance.new("UIListLayout")
local WindowTitle = Instance.new("TextLabel")
local AutoScroll = Instance.new("ImageButton")
local AutoScrollUICorner = Instance.new("UICorner")
local AutoScroll_Inner = Instance.new("Frame")
local AutoScroll_InnerUICorner = Instance.new("UICorner")
local AutoScroll_Title = Instance.new("TextLabel")
local AutoScroll_Title_2 = Instance.new("TextLabel")
local AutoScroll_Enabled = true
STX_Console.Name = "STX_Console"
STX_Console.Parent = game.CoreGui
STX_Console.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
ambientShadow.Name = "ambientShadow"
ambientShadow.Parent = STX_Console
ambientShadow.AnchorPoint = Vector2.new(0.5, 0.5)
ambientShadow.BackgroundTransparency = 1.000
ambientShadow.BorderSizePixel = 0
ambientShadow.Position = GuiPosition
ambientShadow.Size = UDim2.new(0, 610, 0, 510)
ambientShadow.Image = "rbxassetid://1316045217"
ambientShadow.ImageColor3 = Color3.fromRGB(0, 0, 0)
ambientShadow.ImageTransparency = 0.400
ambientShadow.ScaleType = Enum.ScaleType.Slice
ambientShadow.SliceCenter = Rect.new(10, 10, 118, 118)
local UserInputService = game:GetService("UserInputService")
local runService = (game:GetService("RunService"));
local tService = game:GetService("TweenService")
local gui = ambientShadow
local dragging
local dragInput
local dragStart
local startPos
function Lerp(a, b, m)
return a + (b - a) * m
end;
local lastMousePos
local lastGoalPos
local DRAG_SPEED = (DragSpeed); -- // The speed of the UI darg.
function Update(dt)
if not (startPos) then return end;
if not (dragging) and (lastGoalPos) then
gui.Position = UDim2.new(startPos.X.Scale, Lerp(gui.Position.X.Offset, lastGoalPos.X.Offset, dt * DRAG_SPEED), startPos.Y.Scale, Lerp(gui.Position.Y.Offset, lastGoalPos.Y.Offset, dt * DRAG_SPEED))
return
end;
local delta = (lastMousePos - UserInputService:GetMouseLocation())
local xGoal = (startPos.X.Offset - delta.X);
local yGoal = (startPos.Y.Offset - delta.Y);
lastGoalPos = UDim2.new(startPos.X.Scale, xGoal, startPos.Y.Scale, yGoal)
gui.Position = UDim2.new(startPos.X.Scale, Lerp(gui.Position.X.Offset, xGoal, dt * DRAG_SPEED), startPos.Y.Scale, Lerp(gui.Position.Y.Offset, yGoal, dt * DRAG_SPEED))
end;
gui.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragging = true
dragStart = input.Position
startPos = gui.Position
lastMousePos = UserInputService:GetMouseLocation()
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
gui.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
runService.Heartbeat:Connect(Update)
Window.Name = "Window"
Window.Parent = ambientShadow
Window.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
Window.BorderSizePixel = 0
Window.Position = UDim2.new(0, 5, 0, 5)
Window.Size = UDim2.new(0, 600, 0, 500)
Window.ZIndex = 2
Outline_A.Name = "Outline_A"
Outline_A.Parent = Window
Outline_A.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
Outline_A.BorderSizePixel = 0
Outline_A.Position = UDim2.new(0, 0, 0, 40)
Outline_A.Size = UDim2.new(0, 600, 0, 2)
Outline_A.ZIndex = 5
ConsoleContainer.Name = "ConsoleContainer"
ConsoleContainer.Parent = Window
ConsoleContainer.Active = true
ConsoleContainer.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
ConsoleContainer.BackgroundTransparency = 1.000
ConsoleContainer.BorderSizePixel = 0
ConsoleContainer.Position = UDim2.new(0, 10, 0, 50)
ConsoleContainer.Size = UDim2.new(0, 580, 0, 440)
ConsoleContainer.ZIndex = 3
ConsoleContainer.BottomImage = ""
ConsoleContainer.CanvasSize = UDim2.new(0, 0, 0, 0)
ConsoleContainer.ScrollBarThickness = 0
ConsoleContainer.TopImage = ""
ConsoleContainerUIListLayout.Name = "ConsoleContainerUIListLayout"
ConsoleContainerUIListLayout.Parent = ConsoleContainer
ConsoleContainerUIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
ConsoleContainerUIListLayout.Padding = UDim.new(0, 10)
WindowTitle.Name = "WindowTitle"
WindowTitle.Parent = Window
WindowTitle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
WindowTitle.BackgroundTransparency = 1.000
WindowTitle.BorderColor3 = Color3.fromRGB(27, 42, 53)
WindowTitle.BorderSizePixel = 0
WindowTitle.Position = UDim2.new(0, 14, 0, 2)
WindowTitle.Size = UDim2.new(0, 323, 0, 40)
WindowTitle.ZIndex = 4
WindowTitle.Font = Enum.Font.GothamSemibold
WindowTitle.Text = Title
WindowTitle.TextColor3 = Color3.fromRGB(220, 220, 220)
WindowTitle.TextSize = 14.000
WindowTitle.TextXAlignment = Enum.TextXAlignment.Left
AutoScroll.Name = "AutoScroll"
AutoScroll.Parent = Window
AutoScroll.BackgroundColor3 = Color3.fromRGB(58, 58, 58) --(100,100,100) enabled state
AutoScroll.Position = UDim2.new(0, 474, 0, 11)
AutoScroll.Size = UDim2.new(0, 32, 0, 20)
AutoScroll.ZIndex = 3
AutoScrollUICorner.CornerRadius = UDim.new(0, 1000)
AutoScrollUICorner.Name = "AutoScrollUICorner"
AutoScrollUICorner.Parent = AutoScroll
AutoScroll_Inner.Name = "AutoScroll_Inner"
AutoScroll_Inner.Parent = AutoScroll
AutoScroll_Inner.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
AutoScroll_Inner.BorderSizePixel = 0
AutoScroll_Inner.Position = UDim2.new(0, 2, 0, 2) --UDim2.new(0.5, -2, 0, 2) ENABLED STATE
AutoScroll_Inner.Size = UDim2.new(0, 16, 0, 16)
AutoScroll_Inner.ZIndex = 4
AutoScroll_InnerUICorner.CornerRadius = UDim.new(0, 1000)
AutoScroll_InnerUICorner.Name = "AutoScroll_InnerUICorner"
AutoScroll_InnerUICorner.Parent = AutoScroll_Inner
AutoScroll_Title.Name = "AutoScroll_Title"
AutoScroll_Title.Parent = Window
AutoScroll_Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
AutoScroll_Title.BackgroundTransparency = 1.000
AutoScroll_Title.BorderColor3 = Color3.fromRGB(27, 42, 53)
AutoScroll_Title.BorderSizePixel = 0
AutoScroll_Title.Position = UDim2.new(0, 394, 0, 14)
AutoScroll_Title.Size = UDim2.new(0, 80, 0, 14)
AutoScroll_Title.ZIndex = 4
AutoScroll_Title.Font = Enum.Font.GothamSemibold
AutoScroll_Title.Text = "Autoscroll"
AutoScroll_Title.TextColor3 = Color3.fromRGB(220, 220, 220)
AutoScroll_Title.TextSize = 14.000
AutoScroll_Title.TextXAlignment = Enum.TextXAlignment.Left
AutoScroll_Title_2.Name = "AutoScroll_Title_2"
AutoScroll_Title_2.Parent = Window
AutoScroll_Title_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
AutoScroll_Title_2.BackgroundTransparency = 1.000
AutoScroll_Title_2.BorderColor3 = Color3.fromRGB(27, 42, 53)
AutoScroll_Title_2.BorderSizePixel = 0
AutoScroll_Title_2.Position = UDim2.new(0, 520, 0, 14)
AutoScroll_Title_2.Size = UDim2.new(0, 80, 0, 14)
AutoScroll_Title_2.ZIndex = 4
AutoScroll_Title_2.Font = Enum.Font.GothamSemibold
AutoScroll_Title_2.Text = "[RightAlt]"
AutoScroll_Title_2.TextColor3 = Color3.fromRGB(220, 220, 220)
AutoScroll_Title_2.TextSize = 14.000
AutoScroll_Title_2.TextXAlignment = Enum.TextXAlignment.Left
local function ScrollFrame()
if AutoScroll_Enabled then
ConsoleContainer.CanvasPosition = Vector2.new(0, ConsoleContainerUIListLayout.AbsoluteContentSize.Y - ConsoleContainer.AbsoluteSize.Y)
end
end
ConsoleContainerUIListLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(ScrollFrame)
local function ToggleAutoScroll(result)
if result then
AutoScroll_Inner:TweenPosition(UDim2.new(0.5, -2, 0, 2), "InOut", "Sine", .1)
tService:Create(AutoScroll, TweenInfo.new(.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {BackgroundColor3 = Color3.fromRGB(100, 100, 100)}):Play()
else
AutoScroll_Inner:TweenPosition(UDim2.new(0, 2, 0, 2), "InOut", "Sine", .1)
tService:Create(AutoScroll, TweenInfo.new(.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {BackgroundColor3 = Color3.fromRGB(58, 58, 58)}):Play()
end
end
ToggleAutoScroll(AutoScroll_Enabled)
AutoScroll.MouseButton1Click:Connect(function()
AutoScroll_Enabled = not AutoScroll_Enabled
ToggleAutoScroll(AutoScroll_Enabled)
end)
local function ResizeContainer()
ConsoleContainer.CanvasSize = UDim2.new(0, 0, 0, ConsoleContainerUIListLayout.AbsoluteContentSize.Y + ConsoleContainerUIListLayout.Padding.Offset)
end
ConsoleContainerUIListLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(ResizeContainer)
local UserInputService = game:GetService("UserInputService")
local function onInputBegan(input, gameProcessed)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.RightAlt then
STX_Console.Enabled = not STX_Console.Enabled
end
end
end
UserInputService.InputBegan:Connect(onInputBegan)
local ConsoleLog = {}
function ConsoleLog:Prompt(promptdebugger)
local PromptTitle = promptdebugger.Title
local Type = (string.lower(tostring(promptdebugger.Type)));
local now = os.time()
local Time = tostring(pretty_date(os.date("*t", now)))
local DefaultTitle = "["..tostring(Time).."]".." "..tostring(PromptTitle)
local SuccessTitle = "["..tostring(Time).."]".." {Success} : "..tostring(PromptTitle)
local FailTitle = "["..tostring(Time).."]".." {Error} : "..tostring(PromptTitle)
local WarningTitle = "["..tostring(Time).."]".." {Warning} : "..tostring(PromptTitle)
local NofiticationTitle = "["..tostring(Time).."]".." {Nofitication} : "..tostring(PromptTitle)
local TextLabel = Instance.new("TextLabel")
TextLabel.Parent = ConsoleContainer
TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
TextLabel.BackgroundTransparency = 1.000
TextLabel.BorderSizePixel = 0
TextLabel.Size = UDim2.new(0, 580, 0, 12)
TextLabel.ZIndex = 4
TextLabel.Font = Enum.Font.Code
TextLabel.Text = "Nil"
TextLabel.TextColor3 = Color3.fromRGB(220, 220, 220)
TextLabel.TextSize = 14.000
TextLabel.TextXAlignment = Enum.TextXAlignment.Left
--[[
Properties
]]
if Type == ("default") then
TextLabel.Text = tostring(DefaultTitle)
TextLabel.TextColor3 = Color3.fromRGB(220, 220, 220)
elseif Type == ("success") then
TextLabel.Text = tostring(SuccessTitle)
TextLabel.TextColor3 = Color3.fromRGB(83, 230, 50)
elseif Type == ("fail") then
TextLabel.Text = tostring(FailTitle)
TextLabel.TextColor3 = Color3.fromRGB(255, 84, 84)
elseif Type == ("warning") then
TextLabel.Text = tostring(WarningTitle)
TextLabel.TextColor3 = Color3.fromRGB(202, 156, 107)
elseif Type == ("nofitication") then
TextLabel.Text = tostring(NofiticationTitle)
TextLabel.TextColor3 = Color3.fromRGB(121, 130, 255)
end
-- end
end
return ConsoleLog
end
return Console