forked from Insention/ui-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
453 lines (384 loc) · 14.5 KB
/
main.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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local Players = game:GetService("Players")
local CoreGui = game:GetService("CoreGui")
local LocalPlayer = Players.LocalPlayer
local library = {}
function library:Window(title)
local window = {}
local ScreenGui = Instance.new("ScreenGui")
local ImageLabel = Instance.new("ImageLabel")
local Frame = Instance.new("Frame")
local UICorner = Instance.new("UICorner")
local Frame_2 = Instance.new("Frame")
local UICorner_2 = Instance.new("UICorner")
local Frame_3 = Instance.new("Frame")
local TextLabel = Instance.new("TextLabel")
local fiber_manual_record = Instance.new("ImageButton")
local Sample = Instance.new("ImageLabel")
local Frame_4 = Instance.new("Frame")
local UIGradient = Instance.new("UIGradient")
local ScrollingFrame = Instance.new("ScrollingFrame")
local UIListLayout = Instance.new("UIListLayout")
local Frame_5 = Instance.new("Frame")
ImageLabel.Parent = ScreenGui
ImageLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
ImageLabel.BackgroundTransparency = 1.000
ImageLabel.BorderColor3 = Color3.fromRGB(27, 42, 53)
ImageLabel.Position = UDim2.new(0.380452335, 0, 0.192307696, 0)
ImageLabel.Size = UDim2.new(0, 284, 0, 346)
ImageLabel.Image = "rbxassetid://222785823"
ImageLabel.ImageColor3 = Color3.fromRGB(0, 0, 0)
ImageLabel.Parent = ScreenGui
Frame.Parent = ImageLabel
Frame.BackgroundColor3 = Color3.fromRGB(39, 39, 39)
Frame.BorderSizePixel = 0
Frame.Position = UDim2.new(0.0329358876, 0, 0.0282927752, 0)
Frame.Size = UDim2.new(0, 264, 0, 326)
UICorner.Parent = Frame
Frame_2.Parent = Frame
Frame_2.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
Frame_2.BorderSizePixel = 0
Frame_2.Size = UDim2.new(0, 264, 0, 33)
UICorner_2.Parent = Frame_2
Frame_3.Parent = Frame_2
Frame_3.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
Frame_3.BorderSizePixel = 0
Frame_3.Position = UDim2.new(0.00304135401, 0, 0.361861706, 0)
Frame_3.Size = UDim2.new(0, 263, 0, 21)
TextLabel.Parent = Frame_2
TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
TextLabel.BackgroundTransparency = 1.000
TextLabel.Position = UDim2.new(0.174904943, 0, 0.212121218, 0)
TextLabel.Size = UDim2.new(0, 169, 0, 18)
TextLabel.Font = Enum.Font.GothamSemibold
TextLabel.Text = title
TextLabel.TextColor3 = Color3.fromRGB(176, 176, 176)
TextLabel.TextSize = 13.000
fiber_manual_record.Name = "fiber_manual_record"
fiber_manual_record.Parent = Frame_2
fiber_manual_record.BackgroundTransparency = 1.000
fiber_manual_record.LayoutOrder = 17
fiber_manual_record.Position = UDim2.new(0.89733845, 0, 0.181818187, 0)
fiber_manual_record.Size = UDim2.new(0, 20, 0, 20)
fiber_manual_record.ZIndex = 2
fiber_manual_record.Image = "rbxassetid://3926305904"
fiber_manual_record.ImageColor3 = Color3.fromRGB(255, 183, 0)
fiber_manual_record.ImageRectOffset = Vector2.new(204, 484)
fiber_manual_record.ImageRectSize = Vector2.new(36, 36)
Sample.Name = "Sample"
Sample.Parent = ScreenGui
Sample.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
Sample.BackgroundTransparency = 1.000
Sample.Image = "http://www.roblox.com/asset/?id=4560909609"
Sample.ImageTransparency = 0.600
Frame_4.Parent = Frame
Frame_4.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
Frame_4.BorderSizePixel = 0
Frame_4.Position = UDim2.new(0, 0, 0.0992724672, 0)
Frame_4.Size = UDim2.new(0, 262, 0, 8)
UIGradient.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(35, 35, 35)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(39, 39, 39))}
UIGradient.Rotation = 90
UIGradient.Parent = Frame_4
ScrollingFrame.Parent = Frame
ScrollingFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
ScrollingFrame.BackgroundTransparency = 1.000
ScrollingFrame.BorderSizePixel = 0
ScrollingFrame.Position = UDim2.new(0.0303030312, 0, 0.122699387, 0)
ScrollingFrame.Selectable = false
ScrollingFrame.Size = UDim2.new(0, 248, 0, 279)
ScrollingFrame.ScrollBarThickness = 4
UIListLayout.Parent = ScrollingFrame
UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
ScrollingFrame.ChildAdded:Connect(function()
local ab = UIListLayout.AbsoluteContentSize
ScrollingFrame.CanvasSize = UDim2.new(0,0,0,ab.Y)
end)
local UserInputService = game:GetService("UserInputService")
local gui = Frame.Parent
local dragging
local dragInput
local dragStart
local startPos
local function update(input)
local delta = input.Position - dragStart
gui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
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
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)
UserInputService.InputChanged:Connect(function(input)
if input == dragInput and dragging then
update(input)
end
end)
function window:Toggle(text, callback)
local Frame_5 = Instance.new("Frame")
local TextLabel_2 = Instance.new("TextLabel")
local checked = Instance.new("ImageButton")
local Sample_2 = Instance.new("ImageLabel")
local unchecked = Instance.new("ImageButton")
local Sample_3 = Instance.new("ImageLabel")
local Frame_6 = Instance.new("Frame")
Frame_5.Parent = ScrollingFrame
Frame_5.BackgroundColor3 = Color3.fromRGB(157, 144, 111)
Frame_5.BackgroundTransparency = 1.000
Frame_5.Size = UDim2.new(0, 239, 0, 30)
TextLabel_2.Parent = Frame_5
TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
TextLabel_2.BackgroundTransparency = 1.000
TextLabel_2.Position = UDim2.new(0.0368297361, 0, 0.178787738, 0)
TextLabel_2.Size = UDim2.new(0, 189, 0, 18)
TextLabel_2.Font = Enum.Font.GothamSemibold
TextLabel_2.Text = text
TextLabel_2.TextColor3 = Color3.fromRGB(176, 176, 176)
TextLabel_2.TextSize = 13.000
TextLabel_2.TextXAlignment = Enum.TextXAlignment.Left
checked.Name = "checked"
checked.Parent = Frame_5
checked.BackgroundTransparency = 1.000
checked.Position = UDim2.new(0.916318059, 0, 0.13333334, 0)
checked.Size = UDim2.new(0, 20, 0, 20)
checked.ZIndex = 2
checked.Image = "rbxassetid://3926309567"
checked.ImageColor3 = Color3.fromRGB(189, 189, 189)
checked.ImageRectOffset = Vector2.new(784, 420)
checked.ImageRectSize = Vector2.new(48, 48)
checked.ImageTransparency = 1.000
Sample_2.Name = "Sample"
Sample_2.Parent = ScreenGui
Sample_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
Sample_2.BackgroundTransparency = 1.000
Sample_2.Image = "http://www.roblox.com/asset/?id=4560909609"
Sample_2.ImageTransparency = 0.600
unchecked.Name = "unchecked"
unchecked.Parent = Frame_5
unchecked.BackgroundTransparency = 1.000
unchecked.Position = UDim2.new(0.916317999, 0, 0.13333334, 0)
unchecked.Size = UDim2.new(0, 20, 0, 20)
unchecked.ZIndex = 2
unchecked.Image = "rbxassetid://3926309567"
unchecked.ImageColor3 = Color3.fromRGB(189, 189, 189)
unchecked.ImageRectOffset = Vector2.new(628, 420)
unchecked.ImageRectSize = Vector2.new(48, 48)
Sample_3.Name = "Sample"
Sample_3.Parent = ScreenGui
Sample_3.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
Sample_3.BackgroundTransparency = 1.000
Sample_3.Image = "http://www.roblox.com/asset/?id=4560909609"
Sample_3.ImageTransparency = 0.600
local ms = game.Players.LocalPlayer:GetMouse()
local btn = fiber_manual_record
btn.MouseButton1Click:Connect(function()
local c = Sample:Clone()
c.Parent = btn
local x, y = (ms.X - c.AbsolutePosition.X), (ms.Y - c.AbsolutePosition.Y)
c.Position = UDim2.new(0, x, 0, y)
local len, size = 0.35, nil
if btn.AbsoluteSize.X >= btn.AbsoluteSize.Y then
size = (btn.AbsoluteSize.X * 1.5)
else
size = (btn.AbsoluteSize.Y * 1.5)
end
c:TweenSizeAndPosition(UDim2.new(0, size, 0, size), UDim2.new(0.5, (-size / 2), 0.5, (-size / 2)), 'Out', 'Quad', len, true, nil)
for i = 1, 10 do
c.ImageTransparency = c.ImageTransparency + 0.05
wait(len / 12)
end
c:Destroy()
end)
local frame = Frame_5
local enabled = false
function turn()
enabled = not enabled
callback(enabled)
if enabled then
while enabled and checked.ImageTransparency > 0 and wait() do
checked.ImageTransparency = checked.ImageTransparency - 0.2
end
else
while not enabled and checked.ImageTransparency < 1 and wait() do
checked.ImageTransparency = checked.ImageTransparency + 0.2
end
end
end
checked.MouseButton1Click:Connect(turn)
unchecked.MouseButton1Click:Connect(turn)
local ms = game.Players.LocalPlayer:GetMouse()
local btn = checked
btn.MouseButton1Click:Connect(function()
local c = Sample:Clone()
c.Parent = btn
local x, y = (ms.X - c.AbsolutePosition.X), (ms.Y - c.AbsolutePosition.Y)
c.Position = UDim2.new(0, x, 0, y)
local len, size = 0.35, nil
if btn.AbsoluteSize.X >= btn.AbsoluteSize.Y then
size = (btn.AbsoluteSize.X * 1.5)
else
size = (btn.AbsoluteSize.Y * 1.5)
end
c:TweenSizeAndPosition(UDim2.new(0, size, 0, size), UDim2.new(0.5, (-size / 2), 0.5, (-size / 2)), 'Out', 'Quad', len, true, nil)
for i = 1, 10 do
c.ImageTransparency = c.ImageTransparency + 0.05
wait(len / 12)
end
c:Destroy()
end)
local ms = game.Players.LocalPlayer:GetMouse()
local btn = unchecked
btn.MouseButton1Click:Connect(function()
local c = Sample:Clone()
c.Parent = btn
local x, y = (ms.X - c.AbsolutePosition.X), (ms.Y - c.AbsolutePosition.Y)
c.Position = UDim2.new(0, x, 0, y)
local len, size = 0.35, nil
if btn.AbsoluteSize.X >= btn.AbsoluteSize.Y then
size = (btn.AbsoluteSize.X * 1.5)
else
size = (btn.AbsoluteSize.Y * 1.5)
end
c:TweenSizeAndPosition(UDim2.new(0, size, 0, size), UDim2.new(0.5, (-size / 2), 0.5, (-size / 2)), 'Out', 'Quad', len, true, nil)
for i = 1, 10 do
c.ImageTransparency = c.ImageTransparency + 0.05
wait(len / 12)
end
c:Destroy()
end)
end
function window:Slider(text, options, callback)
local Frame_6 = Instance.new("Frame")
local TextLabel_3 = Instance.new("TextLabel")
local TextButton = Instance.new("TextButton")
local Frame_7 = Instance.new("Frame")
local UICorner_3 = Instance.new("UICorner")
local bar = Instance.new("Frame")
local UICorner_4 = Instance.new("UICorner")
local UICorner_5 = Instance.new("UICorner")
local amount = Instance.new("TextLabel")
Frame_6.Parent = ScrollingFrame
Frame_6.BackgroundColor3 = Color3.fromRGB(111, 102, 78)
Frame_6.BackgroundTransparency = 1.000
Frame_6.BorderColor3 = Color3.fromRGB(27, 42, 53)
Frame_6.Position = UDim2.new(0, 0, 0.430107534, 0)
Frame_6.Size = UDim2.new(0, 239, 0, 50)
TextLabel_3.Parent = Frame_6
TextLabel_3.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
TextLabel_3.BackgroundTransparency = 1.000
TextLabel_3.Position = UDim2.new(0.0368297361, 0, 0.135309443, 0)
TextLabel_3.Size = UDim2.new(0, 159, 0, 15)
TextLabel_3.Font = Enum.Font.GothamSemibold
TextLabel_3.Text = text
TextLabel_3.TextColor3 = Color3.fromRGB(176, 176, 176)
TextLabel_3.TextSize = 13.000
TextLabel_3.TextXAlignment = Enum.TextXAlignment.Left
TextButton.Parent = Frame_6
TextButton.BackgroundColor3 = Color3.fromRGB(48, 48, 48)
TextButton.Position = UDim2.new(0.0227645803, 0, 0.559468389, 0)
TextButton.Size = UDim2.new(0, 233, 0, 16)
TextButton.AutoButtonColor = false
TextButton.Font = Enum.Font.SourceSans
TextButton.Text = ""
TextButton.TextColor3 = Color3.fromRGB(0, 0, 0)
TextButton.TextSize = 14.000
Frame_7.Parent = TextButton
Frame_7.BackgroundColor3 = Color3.fromRGB(71, 71, 71)
Frame_7.Position = UDim2.new(0.0167364683, 0, 0.195085526, 0)
Frame_7.Size = UDim2.new(0, 226, 0, 9)
UICorner_3.Parent = Frame_7
bar.Name = "bar"
bar.Parent = Frame_7
bar.BackgroundColor3 = Color3.fromRGB(135, 135, 135)
bar.BorderColor3 = Color3.fromRGB(27, 42, 53)
bar.BorderSizePixel = 0
bar.Size = UDim2.new(0, 36, 0, 9)
UICorner_4.Parent = bar
UICorner_5.Parent = TextButton
amount.Name = "amount"
amount.Parent = Frame_6
amount.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
amount.BackgroundTransparency = 1.000
amount.Position = UDim2.new(0.748126805, 0, 0.135309443, 0)
amount.Size = UDim2.new(0, 56, 0, 15)
amount.Font = Enum.Font.GothamSemibold
amount.Text = "16"
amount.TextColor3 = Color3.fromRGB(176, 176, 176)
amount.TextSize = 14.000
amount.TextXAlignment = Enum.TextXAlignment.Right
local pr = TextButton
local hold = false
local bar = pr.Frame.bar
local amt = pr.Parent.amount
local max = options.max
local default = options.def or options.default
local plr = game.Players.LocalPlayer
local ms = plr:GetMouse()
local rlpos
local rlsiz
local ap = Vector2.new(pr.AbsolutePosition.X, pr.AbsolutePosition.Y)
local as = Vector2.new(pr.AbsoluteSize.X, pr.AbsoluteSize.Y)
amt.Text = tostring(default)
bar.Size = UDim2.new(0, (226/max)*default, 0, 9)
pr.MouseButton1Down:Connect(function()
hold = true
end)
game:GetService('UserInputService').InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
hold = false
end
end)
game:GetService('RunService').RenderStepped:Connect(function()
if hold then
ap = Vector2.new(pr.AbsolutePosition.X, pr.AbsolutePosition.Y)
as = Vector2.new(pr.AbsoluteSize.X, pr.AbsoluteSize.Y)
rlpos = (ms.X-ap.X)
rlsiz = (ms.X-ap.X)
local result = math.floor(max * (rlsiz / 226))
if rlpos > 226 then
result = max
elseif rlpos < 0 then
result = 0
end
if rlsiz <= 226 and rlsiz >= 0 then
amt.Text = tostring(result)
bar.Size = UDim2.new(0, rlsiz, 0, 9)
bar.Visible = true
callback(result)
end
if rlsiz <= 0 then
amt.Text = tostring(0)
bar.Size = UDim2.new(0, 0, 0, 9)
bar.Visible = false
callback(0)
end
if rlsiz >= 226 then
amt.Text = tostring(max)
bar.Size = UDim2.new(0, 226, 0, 9)
bar.Visible = true
callback(max)
end
end
end)
end
pcall(function()
syn.protect_gui(ScreenGui) -- Synapse function makes the ui object undetectable for any non synapse script
end)
ScreenGui.Parent = CoreGui
return window
end
return library