-
Notifications
You must be signed in to change notification settings - Fork 0
/
sniper.lua
297 lines (276 loc) · 11.8 KB
/
sniper.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
local osclock = os.clock()
repeat task.wait() until game:IsLoaded()
setfpscap(5)
game:GetService("RunService"):Set3dRenderingEnabled(false)
local Booths_Broadcast = game:GetService("ReplicatedStorage").Network:WaitForChild("Booths_Broadcast")
local Players = game:GetService('Players')
local getPlayers = Players:GetPlayers()
local PlayerInServer = #getPlayers
local http = game:GetService("HttpService")
local ts = game:GetService("TeleportService")
local rs = game:GetService("ReplicatedStorage")
local vu = game:GetService("VirtualUser")
Players.LocalPlayer.Idled:connect(function()
vu:Button2Down(Vector2.new(0,0),workspace.CurrentCamera.CFrame)
task.wait(1)
vu:Button2Up(Vector2.new(0,0),workspace.CurrentCamera.CFrame)
end)
local function sendWebhookNotification(title, content)
local notificationMessage = {
['content'] = content,
['embeds'] = {
{
['title'] = title,
["color"] = tonumber(0xFF0000),
["timestamp"] = os.date("!%Y-%m-%dT%H:%M:%S.000Z"),
},
}
}
local jsonMessage = http:JSONEncode(notificationMessage)
http:PostAsync(getgenv().webhook, jsonMessage)
end
sendWebhookNotification("Script Started", "Started sniping")
for i = 1, PlayerInServer do
if getPlayers[i] ~= Players.LocalPlayer and getPlayers[i].Character then
getPlayers[i].Character:ClearAllChildren()
end
for ii = 1,#alts do
if getPlayers[i].Name == alts[ii] and alts[ii] ~= Players.LocalPlayer.Name then
jumpToServer()
sendWebhookNotification("Server Hopped", "Alt Found")
end
end
end
local function processListingInfo(uid, gems, item, version, shiny, amount, boughtFrom, boughtStatus)
local gemamount = Players.LocalPlayer.leaderstats["💎 Diamonds"].Value
local snipeMessage = Players.LocalPlayer.Name .. " just sniped a "
if version then
if version == 2 then
version = "Rainbow"
elseif version == 1 then
version = "Golden"
end
else
version = "Normal"
end
snipeMessage = snipeMessage .. version
if shiny then
snipeMessage = snipeMessage .. " Shiny"
end
snipeMessage = snipeMessage .. " " .. (item)
if amount == nil then
amount = 1
end
if boughtPet == true then
local color = tonumber(0x33dd99)
local weburl = webhook
else
local color = tonumber(0xff00000)
local weburl = webhookFail
end
local message1 = {
['content'] = "Goofyahh Sniper",
['embeds'] = {
{
['title'] = snipeMessage,
["color"] = color,
["timestamp"] = DateTime.now():ToIsoDate(),
['fields'] = {
{
['name'] = "PRICE:",
['value'] = tostring(gems) .. " GEMS",
},
{
['name'] = "BOUGHT FROM:",
['value'] = tostring(boughtFrom),
},
{
['name'] = "AMOUNT:",
['value'] = tostring(amount),
},
{
['name'] = "REMAINING GEMS:",
['value'] = tostring(gemamount),
},
{
['name'] = "PETID:",
['value'] = tostring(uid),
},
},
},
}
}
local jsonMessage = http:JSONEncode(message1)
local success, response = pcall(function()
http:PostAsync(getgenv().webhook, jsonMessage)
end)
if success == false then
local response = request({
Url = weburl,
Method = "POST",
Headers = {
["Content-Type"] = "application/json"
},
Body = jsonMessage
})
end
end
local function checklisting(uid, gems, item, version, shiny, amount, username, playerid)
local Library = require(rs:WaitForChild('Library'))
local purchase = rs.Network.Booths_RequestPurchase
gems = tonumber(gems)
local type = {}
pcall(function()
type = Library.Directory.Pets[item]
end)
if type.exclusiveLevel and gems <= 10000 and item ~= "Banana" and item ~= "Coin" then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
elseif type.huge and gems <= 3000000 and not (item == "Huge Hunter") then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
elseif type.titanic and gems <= 10000000 then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
elseif string.find(item, "Crystal Key Upper Half") and gems <= 20000 then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
elseif string.find(item, "Huge") and gems <= 3000000 and not (item == "Huge Hunter") then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
elseif string.find(item, "Crystal Key Lower Half") and gems <= 7500 then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
elseif string.find(item, "Crystal Key") and gems <= 40000 and not (item == "Crystal Key Lower Half" or item == "Crystal Key Upper Half") then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
elseif string.find(item, "Spinny Wheel Ticket") and gems <= 15000 then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
elseif string.find(item, "Titanic Present") and gems <= 300000 then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
elseif string.find(item, "Lucky Block") and gems <= 100000 then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
elseif string.find(item, "Huge Hunter") and gems <= 1000000 then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
elseif string.find(item, "Fortune") and gems <= 110000 and not (item == "Fortune Flag") then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
elseif string.find(item, "Royalty Charm") and gems <= 2500000 then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
elseif string.find(item, "Strength Charm") and gems <= 100000 then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
elseif string.find(item, "Chest Mimic") and gems <= 500000 and not (item == "Present Chest Mimic") then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
elseif string.find(item, "Exclusive Egg") and gems <= 300000 then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
elseif string.find(item, "Titanic Christmas Present") and gems <= 10000 then
local boughtPet, boughtMessage = purchase:InvokeServer(playerid, uid)
if boughtPet == true then
processListingInfo(uid, gems, item, version, shiny, amount, username, boughtPet)
end
end
end
Booths_Broadcast.OnClientEvent:Connect(function(username, message)
local playerID = message['PlayerID']
if type(message) == "table" then
local listing = message["Listings"]
for key, value in pairs(listing) do
if type(value) == "table" then
local uid = key
local gems = value["DiamondCost"]
local itemdata = value["ItemData"]
if itemdata then
local data = itemdata["data"]
if data then
local item = data["id"]
local version = data["pt"]
local shiny = data["sh"]
local amount = data["_am"]
checklisting(uid, gems, item, version, shiny, amount, username , playerID)
end
end
end
end
end
end)
local function jumpToServer()
local sfUrl = "https://games.roblox.com/v1/games/%s/servers/Public?sortOrder=%s&limit=%s&excludeFullGames=true"
local req = request({ Url = string.format(sfUrl, 15502339080, "Desc", 100) })
local body = http:JSONDecode(req.Body)
local deep = math.random(1, 3)
if deep > 1 then
for i = 1, deep, 1 do
req = request({ Url = string.format(sfUrl .. "&cursor=" .. body.nextPageCursor, 15502339080, "Desc", 100) })
body = http:JSONDecode(req.Body)
task.wait(0.1)
end
end
local servers = {}
if body and body.data then
for i = 1, #body.data do
if type(i) == "table" and tonumber(i.playing) and tonumber(i.maxPlayers) and i.playing < i.maxPlayers and i.id ~= game.JobId then
table.insert(servers, 1, i.id)
end
end
end
local randomCount = #servers
if not randomCount then
randomCount = 2
end
ts:TeleportToPlaceInstance(15502339080, servers[math.random(1, randomCount)], game:GetService("Players").LocalPlayer)
end
Players.PlayerAdded:Connect(function(player)
for i = 1,#alts do
if player.Name == alts[i] and alts[i] ~= Players.LocalPlayer.Name then
jumpToServer()
sendWebhookNotification("Server Hopped", "Blacklisted Found")
end
end
end)
game:GetService("RunService").Stepped:Connect(function()
PlayerInServer = #getPlayers
if PlayerInServer < 25 or math.floor(os.clock() - osclock) >= math.random(700, 900) then
jumpToServer()
sendWebhookNotification("Server Hopped", "Less than 25 players or over 11 minutes passed!")
end
end)