local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local Events = ReplicatedStorage:WaitForChild("Events", 10)
local ShowUpgradeScreen = Events:WaitForChild("ShowUpgradeScreen", 10)
local SelectUpgrade = Events:WaitForChild("SelectUpgrade", 10)
local RerollUpgrade = Events:WaitForChild("RerollUpgrade", 10)
local SkipUpgrade = Events:WaitForChild("SkipUpgrade", 10)
local RequestLootCollection = Events:WaitForChild("RequestLootCollection", 10)
local player = Players.LocalPlayer
-- ================================
-- HIT REMOTES (always on)
-- ================================
local hitRemotes = {
{ name = "Hammer", id = "RequestHammerHit" },
{ name = "Thunder Hammer", id = "RequestThunderHammerHit" },
{ name = "Shadow", id = "RequestShadowHit" },
{ name = "Shadow Pulse", id = "RequestShadowPulse" },
{ name = "Voice Shout", id = "RequestVoiceShoutHit" },
{ name = "Doom Echo", id = "RequestDoomEchoHit" },
}
for _, r in ipairs(hitRemotes) do
local ok, remote = pcall(function() return Events:WaitForChild(r.id, 5) end)
r.remote = ok and remote or nil
end
-- ================================
-- PRIORITY TIERS
-- ================================
local tierLimitPower = { "InfinitePower" }
local tierEvolves = { "ThunderHammer", "Supernova", "DoomEcho" }
local tierPriWeapons = { "Hammer", "ShadowOrbit", "VoiceAmplifier" }
local tierOther = { "Shuriken", "SunAura", "CritChance", "XPMultiplier", "CursedSkull", "MaxHealth", "DamageMultiplier" }
local tierLimitSpeed = { "InfiniteHaste" }
local allTiers = {
{ label = "Limit Break: Power", ids = tierLimitPower },
{ label = "Evolve", ids = tierEvolves },
{ label = "Priority Weapon", ids = tierPriWeapons },
{ label = "Build Item", ids = tierOther },
{ label = "Limit Break: Speed", ids = tierLimitSpeed },
}
local function findInTier(upgrades, ids)
local matches = {}
for _, upgrade in ipairs(upgrades) do
if type(upgrade) == "table" then
for _, id in ipairs(ids) do
if upgrade.ID == id then
table.insert(matches, upgrade)
end
end
end
end
table.sort(matches, function(a, b)
return (a.Level or 0) 0 then
for _, r in ipairs(hitRemotes) do
if r.remote then
pcall(function() r.remote:FireServer(enemies) end)
end
end
end
-- Loot
if lootEnabled and hrp then
local lootFolder = workspace:FindFirstChild("Loot")
if lootFolder then
local items = lootFolder:GetChildren()
lootCountLabel.Text = "Loot: " .. #items
for _, loot in ipairs(items) do
if loot:IsA("BasePart") then
loot.CFrame = hrp.CFrame
elseif loot:IsA("Model") then
local root = loot.PrimaryPart or loot:FindFirstChildWhichIsA("BasePart")
if root then loot:SetPrimaryPartCFrame(hrp.CFrame) end
end
pcall(function() RequestLootCollection:FireServer(loot) end)
end
end
else
local lootFolder = workspace:FindFirstChild("Loot")
lootCountLabel.Text = "Loot: " .. (lootFolder and #lootFolder:GetChildren() or 0)
end
-- ==================== FIXED TITAN DODGE ====================
if titanEnabled and hrp then
local titans = getTitanZombies()
if #titans > 0 then
local shouldDodge = false
local closestDist = math.huge
for _, titanHRP in ipairs(titans) do
local dist = (hrp.Position - titanHRP.Position).Magnitude
if dist < SAFE_DISTANCE then
shouldDodge = true
end
if dist 0 then
local pick = matches[1]
SelectUpgrade:FireServer(pick.ID)
pickerTierLabel.Text = "Tier: " .. tier.label
pickerActionLabel.Text = "Action: Selected ✅"
pickerActionLabel.TextColor3 = Color3.fromRGB(100, 255, 100)
pickerLastLabel.Text = "Last: " .. pick.ID .. " (Lv " .. (pick.Level or 1) .. ")"
return
end
end
if cost ~= math.huge and gold >= cost then
RerollUpgrade:FireServer()
pickerActionLabel.Text = "Action: Rerolled 🔄"
pickerActionLabel.TextColor3 = Color3.fromRGB(255, 200, 0)
pickerLastLabel.Text = "Last: Rerolled (" .. cost .. "G)"
else
SkipUpgrade:FireServer()
pickerActionLabel.Text = "Action: Skipped ⏭️"
pickerActionLabel.TextColor3 = Color3.fromRGB(180, 80, 80)
pickerLastLabel.Text = "Last: Skipped (no gold)"
end
end
pickerBtn.MouseButton1Click:Connect(function()
pickerEnabled = not pickerEnabled
setToggle(pickerBtn, pickerEnabled)
pickerStatusLabel.Text = pickerEnabled and "Status: ON" or "Status: OFF"
pickerStatusLabel.TextColor3 = pickerEnabled and Color3.fromRGB(100,255,100) or Color3.fromRGB(180,180,180)
if pickerEnabled then
pickerConnection = ShowUpgradeScreen.OnClientEvent:Connect(onUpgradeScreen)
else
if pickerConnection then
pickerConnection:Disconnect()
pickerConnection = nil
end
end
end)
-- Loot Toggle
lootBtn.MouseButton1Click:Connect(function()
lootEnabled = not lootEnabled
setToggle(lootBtn, lootEnabled)
end)
-- Titan Toggle
local function toggleTitan()
titanEnabled = not titanEnabled
setToggle(titanBtn, titanEnabled)
titanStatusLabel.Text = titanEnabled and "Status: ON | G to toggle" or "Status: OFF | G to toggle"
titanStatusLabel.TextColor3 = titanEnabled and Color3.fromRGB(100,255,100) or Color3.fromRGB(180,180,180)
if not titanEnabled then
titanLastLabel.Text = "Last: Idle"
titanLastLabel.TextColor3 = Color3.fromRGB(120,120,120)
end
end
titanBtn.MouseButton1Click:Connect(toggleTitan)
UserInputService.InputBegan:Connect(function(input, gp)
if gp then return end
if input.KeyCode == Enum.KeyCode.G then
toggleTitan()
end
end)
print("[Master GUI] Loaded! Press G to toggle Titan Dodge.")