local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local HttpService = game:GetService("HttpService")
repeat task.wait() until writefile and readfile and isfile
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hrp = character:WaitForChild("HumanoidRootPart")
local ReadyRemote = ReplicatedStorage:WaitForChild("Systems"):WaitForChild("Waves"):WaitForChild("Ready")
local VoteRemote = ReplicatedStorage:WaitForChild("Systems"):WaitForChild("Voting"):WaitForChild("Vote")
local RoundEnd = player:WaitForChild("PlayerGui"):WaitForChild("RoundEnd")
local rewardsList = RoundEnd
:WaitForChild("Frame")
:WaitForChild("Contents")
:WaitForChild("Rewards")
:WaitForChild("List")
local FILE_NAME = "SummonHeroesResult.json"
local function ReadData()
if not isfile(FILE_NAME) then
writefile(FILE_NAME, "{}")
end
local success, data = pcall(function()
return HttpService:JSONDecode(readfile(FILE_NAME))
end)
if not success then
warn("[File] Corrupted JSON, resetting.")
writefile(FILE_NAME, "{}")
return {}
end
return data
end
local sessionData = ReadData()
local function AddItem(itemName, amount)
sessionData[itemName] = (sessionData[itemName] or 0) + amount
print("[File] Added:", itemName, "Total:", sessionData[itemName])
end
local function Save()
writefile(FILE_NAME, HttpService:JSONEncode(sessionData))
end
local chestsFolder = workspace:WaitForChild("Map"):WaitForChild("BonusChests")
for _, chest in ipairs(chestsFolder:GetChildren()) do
local attachment = chest:FindFirstChild("Attachment")
if not attachment then continue end
local prompt = attachment:FindFirstChildOfClass("ProximityPrompt")
if not prompt then continue end
hrp.CFrame = attachment.WorldCFrame + Vector3.new(0, 3, 0)
task.wait(0.25)
fireproximityprompt(prompt)
task.wait(0.2)
end
local function CollectRewardsFromUI()
print("[Rewards] Collecting from UI...")
for _, item in ipairs(rewardsList:GetChildren()) do
if not item:IsA("TextButton") then continue end
local container = item:FindFirstChild("Container")
if not container then continue end
local countLabel = container:FindFirstChild("InventoryCount")
if not countLabel then continue end
local rawCount = countLabel.Text or ""
local digits = string.gsub(rawCount, "%D", "")
local amount = tonumber(digits) or 1
local itemName = item.Name
if itemName ~= "" then
AddItem(itemName, amount)
end
end
end
task.wait(2)
ReadyRemote:FireServer()
task.wait(1)
RoundEnd:GetPropertyChangedSignal("Enabled"):Connect(function()
if RoundEnd.Enabled then
task.wait(0.5)
CollectRewardsFromUI()
Save()
task.wait(0.2)
VoteRemote:FireServer("Retry")
end
end)🧰 Auto Chest Collection – Collects all bonus chests automatically
🚪 Auto Ready – Sends ready signal without manual input
🎁 Auto Reward Detection – Reads rewards directly from the result UI
📊 Reward Tracker – Tracks collected items and their amounts
💾 JSON File Save – Saves summon results into a local file
🔄 Session Data Loading – Loads previous saved reward data automatically
🛠️ Corrupted File Reset – Resets broken JSON data safely
🔁 Auto Retry Vote – Automatically votes retry after round end
📦 Summon Result Logger – Logs all collected reward items
⚡ Fully Automated Loop – Chest collect, ready, save, and retry in one flow
No comments yet. Be the first to comment!
1local Players = game:GetService("Players")
2local ReplicatedStorage = game:GetService("ReplicatedStorage")
3local HttpService = game:GetService("HttpService")
4
5repeat task.wait() until writefile and readfile and isfile
6
7local player = Players.LocalPlayer
8local character = player.Character or player.CharacterAdded:Wait()
9local hrp = character:WaitForChild("HumanoidRootPart")
10
11local ReadyRemote = ReplicatedStorage:WaitForChild("Systems"):WaitForChild("Waves"):WaitForChild("Ready")
12local VoteRemote = ReplicatedStorage:WaitForChild("Systems"):WaitForChild("Voting"):WaitForChild("Vote")
13
14local RoundEnd = player:WaitForChild("PlayerGui"):WaitForChild("RoundEnd")
15
16local rewardsList = RoundEnd
17 :WaitForChild("Frame")
18 :WaitForChild("Contents")
19 :WaitForChild("Rewards")
20 :WaitForChild("List")
21
22local FILE_NAME = "SummonHeroesResult.json"
23
24local function ReadData()
25 if not isfile(FILE_NAME) then
26 writefile(FILE_NAME, "{}")
27 end
28
29 local success, data = pcall(function()
30 return HttpService:JSONDecode(readfile(FILE_NAME))
31 end)
32
33 if not success then
34 warn("[File] Corrupted JSON, resetting.")
35 writefile(FILE_NAME, "{}")
36 return {}
37 end
38
39 return data
40end
41
42local sessionData = ReadData()
43
44local function AddItem(itemName, amount)
45 sessionData[itemName] = (sessionData[itemName] or 0) + amount
46 print("[File] Added:", itemName, "Total:", sessionData[itemName])
47end
48
49local function Save()
50 writefile(FILE_NAME, HttpService:JSONEncode(sessionData))
51end
52
53local chestsFolder = workspace:WaitForChild("Map"):WaitForChild("BonusChests")
54
55for _, chest in ipairs(chestsFolder:GetChildren()) do
56 local attachment = chest:FindFirstChild("Attachment")
57 if not attachment then continue end
58
59 local prompt = attachment:FindFirstChildOfClass("ProximityPrompt")
60 if not prompt then continue end
61
62 hrp.CFrame = attachment.WorldCFrame + Vector3.new(0, 3, 0)
63 task.wait(0.25)
64
65 fireproximityprompt(prompt)
66 task.wait(0.2)
67end
68
69local function CollectRewardsFromUI()
70 print("[Rewards] Collecting from UI...")
71
72 for _, item in ipairs(rewardsList:GetChildren()) do
73 if not item:IsA("TextButton") then continue end
74
75 local container = item:FindFirstChild("Container")
76 if not container then continue end
77
78 local countLabel = container:FindFirstChild("InventoryCount")
79 if not countLabel then continue end
80
81 local rawCount = countLabel.Text or ""
82 local digits = string.gsub(rawCount, "%D", "")
83 local amount = tonumber(digits) or 1
84
85 local itemName = item.Name
86
87 if itemName ~= "" then
88 AddItem(itemName, amount)
89 end
90 end
91end
92
93task.wait(2)
94ReadyRemote:FireServer()
95
96task.wait(1)
97
98RoundEnd:GetPropertyChangedSignal("Enabled"):Connect(function()
99 if RoundEnd.Enabled then
100 task.wait(0.5)
101
102 CollectRewardsFromUI()
103
104 Save()
105
106 task.wait(0.2)
107
108 VoteRemote:FireServer("Retry")
109 end
110end)