-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathniko
419 lines (317 loc) · 10.1 KB
/
niko
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
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Parent = game.CoreGui
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
ScreenGui.Name = "nikouilib"
local lib = {}
lib.Colors = {}
lib.Colors.Underline = Color3.new(1,0,0)
lib.Colors.Header = Color3.new(0.235294, 0.235294, 0.235294)
lib.Colors.Body = Color3.new(0.27451, 0.27451, 0.27451)
lib.Colors.Text = Color3.new(0.85098, 0.85098, 0.85098)
lib.Colors.Button = Color3.new(0.235294, 0.235294, 0.235294)
lib.Colors.Dropdown = Color3.new(0.196078, 0.196078, 0.196078);
lib.Colors.PlaceholderText = Color3.new(0.635294, 0.635294, 0.635294)
lib.Colors.HideButton = Color3.new(0.941177, 0.941177, 0.941177)
lib.Colors.Border = Color3.new(102/255,102/255,102/255)
lib.Colors.Checkbox = {}
lib.Colors.Checkbox.Checked = Color3.new(230/255,230/255,230/255)
lib.Colors.Checkbox.Unchecked = Color3.new(0.235294, 0.235294, 0.235294)
local function getNextWindowPos()
local biggest = 0;
local ok = nil;
for i,v in pairs(ScreenGui:GetChildren()) do
if v.Position.X.Offset>biggest then
biggest = v.Position.X.Offset
ok = v;
end
end
if biggest == 0 then
biggest = biggest + 5;
else
biggest = biggest + ok.Size.X.Offset + 5;
end
return biggest;
end
function lib:MakeWindow(title)
local Top = Instance.new("Frame")
local Style = Instance.new("Frame")
local Body = Instance.new("Frame")
local Title = Instance.new("TextLabel")
local Hide = Instance.new("TextButton")
Top.Name = title
Top.BackgroundColor3 = lib.Colors.Header
Top.BorderSizePixel = 0
Top.Position = UDim2.new(0, getNextWindowPos()+ 100, 0, 100)
Top.Size = UDim2.new(0, 250, 0, 25)
Top.Active = true
Top.Draggable = true;
Top.Parent = ScreenGui
Style.Name = "Style"
Style.Parent = Top
Style.BackgroundColor3 = lib.Colors.Underline
Style.BorderSizePixel = 0
Style.Position = UDim2.new(0, 0, 1, 0)
Style.Size = UDim2.new(1, 0, 0, 2)
Body.Name = "Body"
Body.Parent = Style
Body.BackgroundColor3 = lib.Colors.Body
Body.BorderSizePixel = 0
Body.Position = UDim2.new(0, 0, 1, 0)
Body.Size = UDim2.new(1, 0, 0, 85)
Title.Name = "Title"
Title.Parent = Top
Title.BackgroundColor3 = Color3.new(1, 1, 1)
Title.BackgroundTransparency = 1
Title.Position = UDim2.new(0, 5, 0, 0)
Title.Size = UDim2.new(0, 1, 1, 0)
Title.Font = Enum.Font.Code
Title.Text = title
Title.TextColor3 = lib.Colors.Text
Title.TextSize = 14
Title.TextXAlignment = Enum.TextXAlignment.Left
Hide.Name = "Hide"
Hide.Parent = Top
Hide.BackgroundColor3 = Color3.new(1, 1, 1)
Hide.BackgroundTransparency = 1
Hide.Position = UDim2.new(1, -25, 0, 0)
Hide.Size = UDim2.new(0, 25, 1, 0)
Hide.Font = Enum.Font.GothamBold
Hide.Text = "-"
Hide.TextColor3 = lib.Colors.HideButton
Hide.TextSize = 14
local hidden = true;
Hide.MouseButton1Click:connect(function()
hidden = not hidden;
Body.Visible = hidden;
end)
local ez = {}
ez.Frame = Top;
local nextpos = 5;
local function getNextPos()
local biggest = 0;
local ok = nil;
for i,v in pairs(Body:GetChildren()) do
if v.Position.Y.Offset>biggest then
biggest = v.Position.Y.Offset
ok = v;
end
end
if biggest == 0 then
biggest = biggest + 5;
else
biggest = biggest + ok.Size.Y.Offset + 5;
end
return biggest;
end
function ez:addCheckbox(title)
local Checkbox = Instance.new("TextButton")
local CheckboxLabel = Instance.new("TextLabel")
local checked = Instance.new("BoolValue")
Checkbox.Name = "Checkbox"
Checkbox.BackgroundColor3 = lib.Colors.Checkbox.Unchecked
Checkbox.BorderColor3 = lib.Colors.Border
Checkbox.Size = UDim2.new(0, 20, 0, 20)
Checkbox.Font = Enum.Font.GothamBold
Checkbox.Text = ""
Checkbox.TextColor3 = lib.Colors.Text
Checkbox.TextSize = 14
CheckboxLabel.Name = "CheckboxLabel"
CheckboxLabel.Parent = Checkbox
CheckboxLabel.BackgroundColor3 = Color3.new(1, 1, 1)
CheckboxLabel.BackgroundTransparency = 1
CheckboxLabel.Position = UDim2.new(1, 5, 0, -2)
CheckboxLabel.Size = UDim2.new(0, 200, 0, 25)
CheckboxLabel.Font = Enum.Font.Code
CheckboxLabel.Text = title
CheckboxLabel.TextColor3 = lib.Colors.Text
CheckboxLabel.TextSize = 15
CheckboxLabel.TextWrapped = true
CheckboxLabel.TextXAlignment = Enum.TextXAlignment.Left
checked.Parent = Checkbox
Checkbox.Position = UDim2.new(0, 5, 0, getNextPos())
Checkbox.Parent = Body
Body.Size = UDim2.new(1,0,0,getNextPos())
Checkbox.MouseButton1Click:connect(function()
if checked.Value then
checked.Value = false;
Checkbox.BackgroundColor3 = lib.Colors.Checkbox.Unchecked
else
checked.Value = true;
Checkbox.BackgroundColor3 = lib.Colors.Checkbox.Checked
end
end)
local cb = {}
cb.Checked = checked;
cb.Frame = Checkbox
return cb
end
function ez:addButton(title,func)
local Button = Instance.new("TextButton")
Button.Name = "Button"
Button.BackgroundColor3 = lib.Colors.Button
Button.BorderColor3 = lib.Colors.Border
Button.Size = UDim2.new(0, 240, 0, 20)
Button.Font = Enum.Font.Code
Button.Text = title
Button.TextColor3 = lib.Colors.Text
Button.TextSize = 15
Button.Position = UDim2.new(0, 5, 0, getNextPos())
Body.Size = UDim2.new(1,0,0,getNextPos()+5)
Button.Parent = Body
Body.Size = UDim2.new(1,0,0,getNextPos())
Button.MouseButton1Click:connect(func)
end
function ez:addTextBox(title)
local TextBox = Instance.new("TextBox")
TextBox.BackgroundColor3 = lib.Colors.Button
TextBox.BorderColor3 = lib.Colors.Border
TextBox.Size = UDim2.new(0, 240, 0, 20)
TextBox.Font = Enum.Font.Code
TextBox.PlaceholderColor3 = lib.Colors.PlaceholderText
TextBox.PlaceholderText = title
TextBox.Text = ""
TextBox.TextColor3 = lib.Colors.Text
TextBox.TextSize = 14
TextBox.TextWrapped = true
TextBox.ZIndex = 1;
TextBox.Position = UDim2.new(0, 5, 0, getNextPos())
TextBox.Parent = Body
local k = Instance.new("StringValue",TextBox)
Body.Size = UDim2.new(1,0,0,getNextPos());
local r = {}
TextBox.Changed:connect(function()
k.Value = TextBox.Text;
end)
r.Text = k;
r.Frame = TextBox
return r;
end
function ez:addTextBoxF(title,func)
local TextBox = Instance.new("TextBox")
TextBox.BackgroundColor3 = lib.Colors.Button
TextBox.BorderColor3 = lib.Colors.Border
TextBox.Size = UDim2.new(0, 240, 0, 20)
TextBox.Font = Enum.Font.Code
TextBox.PlaceholderColor3 = lib.Colors.PlaceholderText
TextBox.PlaceholderText = title
TextBox.Text = ""
TextBox.TextColor3 = lib.Colors.Text
TextBox.TextSize = 14
TextBox.TextWrapped = true
TextBox.ZIndex = 1;
TextBox.Position = UDim2.new(0, 5, 0, getNextPos())
local val = Instance.new"StringValue"
val.Parent = TextBox
val.Value = "";
TextBox.Parent = Body
Body.Size = UDim2.new(1,0,0,getNextPos());
TextBox.Changed:connect(function()
val.Value = TextBox.Text
end)
TextBox.FocusLost:connect(function(enterPressed)
if enterPressed then
func(val.Value)
end
end)
return val;
end
function ez:addLabel(text,align)
local Label = Instance.new("TextLabel")
Label.Name = "Label"
Label.BackgroundColor3 = Color3.new(1, 1, 1)
Label.BackgroundTransparency = 1
Label.Position = UDim2.new(0, 5, 0, 110)
Label.Size = UDim2.new(1, -10, 0, 15)
Label.Font = Enum.Font.Code
Label.Text = text
Label.TextColor3 = lib.Colors.Text
Label.TextSize = 15
Label.TextWrapped = true
Label.TextXAlignment = Enum.TextXAlignment[align]
local val = Instance.new"StringValue"
val.Parent = Label
val.Value = text;
Label.Position = UDim2.new(0, 5, 0, getNextPos())
Label.Parent = Body
Body.Size = UDim2.new(1,0,0,getNextPos()+5)
val.Changed:connect(function()
Label.Text = val.Value
end)
return val;
end
function ez:addDropdown(options)
local Dropdown = Instance.new("TextLabel")
local DropdownBtn = Instance.new("ImageButton")
Dropdown.Name = "Dropdown"
Dropdown.BackgroundColor3 = lib.Colors.Dropdown
Dropdown.BorderSizePixel = 0
Dropdown.Size = UDim2.new(0, 240, 0, 25)
Dropdown.Font = Enum.Font.Code
Dropdown.Text = " "..options[1]
Dropdown.TextColor3 = lib.Colors.Text
Dropdown.TextSize = 15
Dropdown.TextWrapped = true
Dropdown.TextXAlignment = Enum.TextXAlignment.Left
Dropdown.ZIndex = 4;
DropdownBtn.Name = "DropdownBtn"
DropdownBtn.Parent = Dropdown
DropdownBtn.BackgroundColor3 = lib.Colors.Dropdown
DropdownBtn.BackgroundTransparency = 1
DropdownBtn.Position = UDim2.new(1, -25, 0, 0)
DropdownBtn.Size = UDim2.new(0, 25, 1, 0)
DropdownBtn.Image = "rbxassetid://293296862"
local items = Instance.new("Folder")
items.Parent = Dropdown
items.Name = "items"
local open = Instance.new("BoolValue")
open.Parent = Dropdown
open.Name = "Open"
open.Value = false;
local selected = Instance.new("StringValue")
selected.Parent = Dropdown
selected.Value = "Selected"
selected.Value = options[1]
Dropdown.Position = UDim2.new(0, 5, 0, getNextPos())
Body.Size = UDim2.new(1,0,0,getNextPos()+5)
Dropdown.Parent = Body
Body.Size = UDim2.new(1,0,0,getNextPos())
for i,v in pairs(options) do
local option = Instance.new("TextButton")
option.Name = v
option.Parent = items
option.BackgroundColor3 = lib.Colors.Dropdown
option.BorderColor3 = lib.Colors.Border
option.BorderSizePixel = 0
option.Position = UDim2.new(0, 0, #items:GetChildren(), 0)
option.Size = UDim2.new(0, 240, 0, 25)
option.Font = Enum.Font.Code
option.Text = " "..v
option.TextColor3 = lib.Colors.Text
option.TextSize = 15
option.TextXAlignment = Enum.TextXAlignment.Left
option.Visible = false;
option.ZIndex = 5;
option.MouseButton1Click:connect(function()
selected.Value = v;
open.Value = false;
for i,v in pairs(items:GetChildren()) do
v.Visible = false;
end
Dropdown.Text = " "..v;
end)
end
DropdownBtn.MouseButton1Click:connect(function()
for i,v in pairs(items:GetChildren()) do
open.Value = true;
v.Visible = true;
end
end)
local dr = {}
dr.Open = open
dr.Selected = selected
dr.Frame = Dropdown
return dr;
end
return ez;
end
return lib;