-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUntitled Drill Game.lua
More file actions
430 lines (370 loc) · 11.1 KB
/
Copy pathUntitled Drill Game.lua
File metadata and controls
430 lines (370 loc) · 11.1 KB
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
local plrs = game.Players
local plr = plrs.LocalPlayer
local char = plr.Character
local drilling = false
local selling = false
local collecting = false
local storage = false
local rebirthing = false
local selectedDrill = nil
local selectedHandDrill = nil
local selectedPlayer = nil
local function drill()
if char:FindFirstChildOfClass("Tool") and string.match(char:FindFirstChildOfClass("Tool").Name, "Hand") then
game:GetService("ReplicatedStorage").Packages.Knit.Services.OreService.RE.RequestRandomOre:FireServer()
else
for _,v in ipairs(plr.Backpack:GetChildren()) do
if string.match(v.Name, "Hand") then
char.Humanoid:EquipTool(v)
game:GetService("ReplicatedStorage").Packages.Knit.Services.OreService.RE.RequestRandomOre:FireServer()
break
end
end
end
end
local function sell()
for _,v in next, plr.Backpack:GetChildren() do
if not string.match(v.Name, "Drill") then
if v:IsA("Tool") and v:FindFirstChild("Handle") then
local old = char:GetPivot()
char:PivotTo(workspace["Sell Shop"]:GetPivot())
task.wait(0.1)
game:GetService("ReplicatedStorage").Packages.Knit.Services.OreService.RE.SellAll:FireServer()
task.wait(0.1)
char:PivotTo(old)
end
end
end
end
local function getPlot()
for _,v in next, workspace.Plots:GetChildren() do
if v:FindFirstChild("Owner") and v:FindFirstChild("Owner").Value == plr then
return v
end
end
end
local function collectDrills()
for _,v in next, getPlot():FindFirstChild("Drills"):GetChildren() do
if v:FindFirstChild("Ores") and v:FindFirstChild("Ores"):FindFirstChild("TotalQuantity") and v:FindFirstChild("Ores"):FindFirstChild("TotalQuantity").Value > 0 then
game:GetService("ReplicatedStorage").Packages.Knit.Services.PlotService.RE.CollectDrill:FireServer(v)
end
end
end
local function collectStorage()
for _,v in next, getPlot():FindFirstChild("Storage"):GetChildren() do
if v:FindFirstChild("Ores") and v:FindFirstChild("Ores"):FindFirstChild("TotalQuantity") and v:FindFirstChild("Ores"):FindFirstChild("TotalQuantity").Value > 0 then
game:GetService("ReplicatedStorage").Packages.Knit.Services.PlotService.RE.CollectDrill:FireServer(v)
end
end
end
local function rebirth()
local reb = plr.PlayerGui.Menu.CanvasGroup.Rebirth.Background
local progress = reb.Progress.Checkmark.Image == "rbxassetid://131015443699741"
local ores = reb.RequiredOres:GetChildren()
if #ores >= 2 then
local ore1 = ores[1]:FindFirstChild("Checkmark")
local ore2 = ores[2]:FindFirstChild("Checkmark")
if progress
and ore1 and ore1.Image == "rbxassetid://131015443699741"
and ore2 and ore2.Image == "rbxassetid://131015443699741" then
game:GetService("ReplicatedStorage").Packages.Knit.Services.RebirthService.RE.RebirthRequest:FireServer()
end
end
end
local function formatPrice(num)
local formatted = tostring(num)
local k
while true do
formatted, k = formatted:gsub("^(-?%d+)(%d%d%d)", '%1,%2')
if k == 0 then break end
end
return "$" .. formatted
end
local function getDrillsSortedByPrice()
local drills = {}
for _, frame in pairs(plr.PlayerGui.Menu.CanvasGroup.Buy.Background.DrillList:GetChildren()) do
if frame:IsA("Frame") then
local priceLabel = frame:FindFirstChild("Buy")
and frame.Buy:FindFirstChild("TextLabel")
local titleLabel = frame:FindFirstChild("Title")
if priceLabel and titleLabel then
local priceText = priceLabel.Text
local cleanPriceText = priceText:gsub("[%$,]", "")
local price = tonumber(cleanPriceText)
if price then
table.insert(drills, {
name = titleLabel.Text,
price = price,
frame = frame
})
end
end
end
end
table.sort(drills, function(a, b)
return a.price < b.price
end)
return drills
end
local sortedDrills = getDrillsSortedByPrice()
local drillNames = {}
for _, drill in ipairs(sortedDrills) do
table.insert(drillNames, drill.name)
end
local function getHandDrillsSortedByPrice()
local drills = {}
for _, frame in pairs(plr.PlayerGui.Menu.CanvasGroup.HandDrills.Background.HandDrillList:GetChildren()) do
if frame:IsA("Frame") then
local priceLabel = frame:FindFirstChild("Buy")
and frame.Buy:FindFirstChild("TextLabel")
local titleLabel = frame:FindFirstChild("Title")
if priceLabel and titleLabel then
local priceText = priceLabel.Text
local cleanPriceText = priceText:gsub("[%$,]", "")
local price = tonumber(cleanPriceText)
if price then
table.insert(drills, {
name = titleLabel.Text,
price = price,
frame = frame
})
end
end
end
end
table.sort(drills, function(a, b)
return a.price < b.price
end)
return drills
end
local sortedHandDrills = getHandDrillsSortedByPrice()
local handDrillNames = {}
for _, drill in ipairs(sortedHandDrills) do
table.insert(handDrillNames, drill.name)
end
local function getDrillPrice()
if not selectedDrill then return end
for _,v in next, plr.PlayerGui.Menu.CanvasGroup.Buy.Background.DrillList:GetDescendants() do
if v:IsA("TextLabel") and v.Name == "Title" and v.Text == selectedDrill then
return v.Parent:FindFirstChild("Buy").TextLabel.Text
end
end
end
local function getHandDrillPrice()
if not selectedHandDrill then return end
for _,v in next, plr.PlayerGui.Menu.CanvasGroup.HandDrills.Background.HandDrillList:GetDescendants() do
if v:IsA("TextLabel") and v.Name == "Title" and v.Text == selectedHandDrill then
return v.Parent:FindFirstChild("Buy").TextLabel.Text
end
end
end
local function get()
local t = {}
for _, p in ipairs(plrs:GetPlayers()) do
if p == plr then continue end
t[#t + 1] = p.Name
end
return t
end
local ui = loadstring(game:HttpGet("https://github.com/Footagesus/WindUI/releases/latest/download/main.lua"))()
local win = ui:CreateWindow({
Title = "Untitled Drill Game",
Icon = "terminal",
Folder = nil,
Size = UDim2.fromOffset(580, 460),
Transparent = true,
Theme = "Dark",
SideBarWidth = 200,
Background = "",
})
local tab = win:Tab({
Title = "Main",
Icon = "pickaxe",
})
tab:Section({
Title = "Farming",
TextXAlignment = "Left",
TextSize = 17,
})
tab:Toggle({
Title = "Drill Ores",
Type = "Toggle",
Default = false,
Callback = function(state)
drilling = state
if drilling then
task.spawn(function()
while drilling do
drill()
task.wait()
end
end)
end
end
})
tab:Toggle({
Title = "Sell Ores",
Type = "Toggle",
Default = false,
Callback = function(state)
selling = state
if selling then
task.spawn(function()
while selling do
sell()
task.wait()
end
end)
end
end
})
tab:Toggle({
Title = "Collect Ores From Drills",
Type = "Toggle",
Default = false,
Callback = function(state)
collecting = state
if collecting then
task.spawn(function()
while collecting do
collectDrills()
task.wait()
end
end)
end
end
})
tab:Toggle({
Title = "Collect Ores From Storage",
Type = "Toggle",
Default = false,
Callback = function(state)
storage = state
if storage then
task.spawn(function()
while storage do
collectStorage()
task.wait()
end
end)
end
end
})
tab:Toggle({
Title = "Rebirth",
Type = "Toggle",
Default = false,
Callback = function(state)
rebirthing = state
if rebirthing then
task.spawn(function()
while rebirthing do
rebirth()
task.wait(1)
end
end)
end
end
})
tab:Section({
Title = "Buying",
TextXAlignment = "Left",
TextSize = 17,
})
local Paragraph = tab:Paragraph({
Title = "Selected Drill Price: N/A",
Locked = false,
})
local Dropdown = tab:Dropdown({
Title = "Drill List",
Values = drillNames,
Value = nil,
Callback = function(option)
selectedDrill = option
local price = getDrillPrice() or "N/A"
Paragraph:SetTitle("Selected Drill Price: " .. price)
end
})
tab:Button({
Title = "Buy Drill",
Locked = false,
Callback = function()
if selectedDrill then
game:GetService("ReplicatedStorage").Packages.Knit.Services.OreService.RE.BuyDrill:FireServer(selectedDrill)
end
end
})
local Paragraph2 = tab:Paragraph({
Title = "Selected Hand Drill Price: N/A",
Locked = false,
})
local Dropdown = tab:Dropdown({
Title = "Hand Drill List",
Values = handDrillNames,
Value = nil,
Callback = function(option)
selectedHandDrill = option
local price = getHandDrillPrice() or "N/A"
Paragraph2:SetTitle("Selected Hand Drill Price: " .. price)
end
})
tab:Button({
Title = "Buy Hand Drill",
Locked = false,
Callback = function()
if selectedHandDrill then
game:GetService("ReplicatedStorage").Packages.Knit.Services.OreService.RE.BuyHandDrill:FireServer(selectedHandDrill)
end
end
})
local tab = win:Tab({
Title = "Miscellaneous",
Icon = "person-standing",
})
tab:Section({
Title = "Player",
TextXAlignment = "Left",
TextSize = 17,
})
local Slider = tab:Slider({
Title = "WalkSpeed",
Step = 1,
Value = {
Min = 0,
Max = 500,
Default = plr.Character.Humanoid.WalkSpeed,
},
Callback = function(value)
plr.Character.Humanoid.WalkSpeed = value
end
})
local Slider = tab:Slider({
Title = "JumpPower",
Step = 1,
Value = {
Min = 0,
Max = 500,
Default = plr.Character.Humanoid.JumpPower,
},
Callback = function(value)
plr.Character.Humanoid.JumpPower = value
end
})
local Dropdown = tab:Dropdown({
Title = "Select Player",
Values = get(),
Value = nil,
Callback = function(option)
selectedPlayer = option
end
})
plrs.PlayerAdded:Connect(function()
Dropdown:Refresh(get())
end)
local Button = tab:Button({
Title = "Teleport To Player",
Locked = false,
Callback = function()
char:PivotTo(plrs[selectedPlayer].Character:GetPivot())
end
})