-
Notifications
You must be signed in to change notification settings - Fork 0
/
methodrrals.lua
302 lines (253 loc) · 10.4 KB
/
methodrrals.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
local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local username = player.Name
local HttpService = game:GetService("HttpService")
local requestt = http_request or request or syn.request
local FileSys = loadstring(game:HttpGet("https://raw.githubusercontent.com/AhmadV99/Main/main/Library/File_System.lua"))()
do
FileSys:GetFolder("JG")
FileSys:GetFolder("JG/ALS")
FileSys:GetFile("JG/ALS" .. username .. "_playerstats.json")
end
local headers = {
["Content-Type"] = "application/json"
}
function GetRewards()
local rewardsPath = game:GetService("Players").LocalPlayer:FindFirstChild("PlayerGui"):FindFirstChild("EndGameUI"):FindFirstChild("BG"):FindFirstChild("Container"):FindFirstChild("Rewards"):FindFirstChild("Holder")
local rewardList = {}
if rewardsPath then
for _, item in pairs(rewardsPath:GetChildren()) do
if not item.Name:match("^UI") then
local amount = "Unknown"
local amountInstance = item:FindFirstChild("Amount")
if amountInstance then
if amountInstance:IsA("TextLabel") or amountInstance:IsA("TextButton") then
amount = amountInstance.Text
elseif amountInstance:IsA("IntValue") or amountInstance:IsA("NumberValue") then
amount = amountInstance.Value
end
end
table.insert(rewardList, item.Name .. " " .. amount)
end
end
end
return rewardList
end
function GetMapInfo()
local map = game:GetService("Workspace"):FindFirstChild("Map")
local mapName = ""
local mapDifficulty = ""
if map then
local mapNameInstance = map:FindFirstChild("MapName")
local mapDifficultyInstance = map:FindFirstChild("MapDifficulty")
if mapNameInstance and mapNameInstance:IsA("StringValue") then
mapName = mapNameInstance.Value
end
if mapDifficultyInstance and mapDifficultyInstance:IsA("StringValue") then
mapDifficulty = mapDifficultyInstance.Value
end
end
return mapName, mapDifficulty
end
function GetStats()
local statsPath = game:GetService("Players").LocalPlayer:FindFirstChild("PlayerGui"):FindFirstChild("EndGameUI"):FindFirstChild("BG"):FindFirstChild("Container"):FindFirstChild("Stats")
local endWave = "Unknown"
local elapsedTime = "Unknown"
if statsPath then
local endWaveInstance = statsPath:FindFirstChild("EndWave")
local elapsedTimeInstance = statsPath:FindFirstChild("ElapsedTime")
if endWaveInstance and endWaveInstance:IsA("TextLabel") then
endWave = endWaveInstance.Text
end
if elapsedTimeInstance and elapsedTimeInstance:IsA("TextLabel") then
elapsedTime = elapsedTimeInstance.Text
end
end
return endWave, elapsedTime
end
function LoadPlayerStats()
local path = "JG/ALS/"
local fileName = path .. username .. "_playerstats.json"
local stats = {}
if isfile(fileName) then
local fileContent = FileSys:ReadFile(fileName)
stats = HttpService:JSONDecode(fileContent)
else
warn("Player stats file not found: " .. fileName)
end
return stats
end
function Webhook()
local rewards = GetRewards()
local mapName, mapDifficulty = GetMapInfo()
local endWave, elapsedTime = GetStats()
local playerStats = LoadPlayerStats()
local rewardField = {
["name"] = 'Reward',
["value"] = '',
["inline"] = false
}
if #rewards > 0 then
rewardField["value"] = "+ " .. table.concat(rewards, "\n+ ")
else
rewardField["value"] = "No rewards found."
end
local statsField = {
["name"] = 'Stats',
["value"] = "• Map Name: " .. mapName .. "\n" ..
"• Difficulty: " .. mapDifficulty .. "\n" ..
"• " .. endWave .. "\n" ..
"• " .. elapsedTime,
["inline"] = false
}
local playerStatsField = {
["name"] = 'Player Stats',
["value"] = "• EXP: " .. (playerStats.EXP or "Not Found") .. "\n" ..
"• Gold: " .. (playerStats.Gold or "Not Found") .. "\n" ..
"• Emeralds: " .. (playerStats.Emeralds or "Not Found") .. "\n" ..
"• Jewels: " .. (playerStats.Jewels or "Not Found") .. "\n" ..
"• Halloween Currency: " .. (playerStats.Halloween_currency or "Not Found") .. "\n" ..
"• Rerolls: " .. (playerStats.Rerolls or "Not Found"),
["inline"] = false
}
local data = {
["embeds"] = {
{
["title"] = "JG ALS",
["type"] = "rich",
["color"] = tonumber(0x58b9ff),
["fields"] = {
{
["name"] = 'Name',
["value"] = "||"..game:GetService("Players").LocalPlayer.Name.."||",
["inline"] = false
},
playerStatsField,
statsField,
rewardField
}
}
}
}
local newdata = HttpService:JSONEncode(data)
requestt({Url = getgenv().Webhook, Body = newdata, Method = "POST", Headers = headers})
end
function SavePlayerStats()
local stats = {}
local playerFolder = game:GetService("Players"):FindFirstChild(username)
if playerFolder then
local currencyFiles = {"EXP", "Gold", "Emeralds", "Jewels", "Halloween_currency", "Rerolls"}
for _, currency in pairs(currencyFiles) do
local valueInstance = playerFolder:FindFirstChild(currency)
if valueInstance then
stats[currency] = valueInstance:IsA("IntValue") and valueInstance.Value or "Unknown"
else
stats[currency] = "Not Found"
end
end
end
local path = "JG/ALS/"
local fileName = path .. username .. "_playerstats.json"
local success, err = pcall(function()
FileSys:WriteFile(fileName, stats)
end)
if success then
print("Player stats saved to " .. fileName)
else
warn("Failed to save player stats: " .. err)
end
end
if game.PlaceId == 12886143095 then
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "BlackScreenGui"
screenGui.Parent = playerGui
local blackFrame = Instance.new("Frame")
blackFrame.Size = UDim2.new(1, 0, 1, 0)
blackFrame.Position = UDim2.new(0, 0, 0, 0)
blackFrame.BackgroundColor3 = Color3.new(0, 0, 0)
blackFrame.BackgroundTransparency = 0
blackFrame.Parent = screenGui
local titleLabel = Instance.new("TextLabel")
titleLabel.Size = UDim2.new(0, 300, 0, 50)
titleLabel.Position = UDim2.new(0.5, -150, 0.4, -25)
titleLabel.Text = "JG ALS Farm Reroll"
titleLabel.TextColor3 = Color3.new(1, 1, 1)
titleLabel.BackgroundTransparency = 1
titleLabel.TextScaled = true
titleLabel.Parent = screenGui
local authorLabel = Instance.new("TextLabel")
authorLabel.Size = UDim2.new(0, 300, 0, 50)
authorLabel.Position = UDim2.new(0.5, -150, 0.5, -25)
authorLabel.Text = "Made by: Jung Ganmyeon"
authorLabel.TextColor3 = Color3.new(1, 1, 1)
authorLabel.BackgroundTransparency = 1
authorLabel.TextScaled = true
authorLabel.Parent = screenGui
SavePlayerStats()
local character = player.Character or player.CharacterAdded:Wait()
local hrp = character:WaitForChild("HumanoidRootPart")
hrp.CFrame = CFrame.new(717.270203, 291.576599, 461.668304)
while true do
local playinfcastle = {
[1] = "Play",
[2] = 5,
[3] = true
}
game:GetService("ReplicatedStorage").Remotes.InfiniteCastleManager:FireServer(unpack(playinfcastle))
wait(4)
end
else
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "BlackScreenGui"
screenGui.Parent = playerGui
local blackFrame = Instance.new("Frame")
blackFrame.Size = UDim2.new(1, 0, 1, 0)
blackFrame.Position = UDim2.new(0, 0, 0, 0)
blackFrame.BackgroundColor3 = Color3.new(0, 0, 0)
blackFrame.BackgroundTransparency = 0
blackFrame.Parent = screenGui
local titleLabel = Instance.new("TextLabel")
titleLabel.Size = UDim2.new(0, 300, 0, 50)
titleLabel.Position = UDim2.new(0.5, -150, 0.4, -25)
titleLabel.Text = "JG ALS Farm Reroll"
titleLabel.TextColor3 = Color3.new(1, 1, 1)
titleLabel.BackgroundTransparency = 1
titleLabel.TextScaled = true
titleLabel.Parent = screenGui
local authorLabel = Instance.new("TextLabel")
authorLabel.Size = UDim2.new(0, 300, 0, 50)
authorLabel.Position = UDim2.new(0.5, -150, 0.5, -25)
authorLabel.Text = "Made by: Jung Ganmyeon"
authorLabel.TextColor3 = Color3.new(1, 1, 1)
authorLabel.BackgroundTransparency = 1
authorLabel.TextScaled = true
authorLabel.Parent = screenGui
while true do
local slot1Name = player:WaitForChild("Slots"):WaitForChild("Slot1").Value
local argsPlace = {
[1] = slot1Name,
[2] = CFrame.new(-153.9479217529297, 203.8927764892578, 4.945199966430664) * CFrame.Angles(0, 0, 0)
}
game:GetService("ReplicatedStorage").Remotes.PlaceTower:FireServer(unpack(argsPlace))
wait(1)
local argsUpgrade = {
[1] = workspace.Towers[slot1Name]
}
game:GetService("ReplicatedStorage").Remotes.Upgrade:InvokeServer(unpack(argsUpgrade))
local speed = {
[1] = true
}
game:GetService("ReplicatedStorage").Remotes.VoteChangeTimeScale:FireServer(unpack(speed))
local gameEnded = game:GetService("ReplicatedStorage"):WaitForChild("GameEnded")
if gameEnded.Value then
Webhook()
print("Game has ended. Teleporting back...")
wait(3)
local teleportArgs = {
[1] = player
}
game:GetService("ReplicatedStorage").Remotes.TeleportBack:FireServer(unpack(teleportArgs))
break
end
end
end