local repo = "https://raw.githubusercontent.com/deividcomsono/Obsidian/main/" local Library = loadstring(game:HttpGet(repo .. "Library.lua"))() local ThemeManager = loadstring(game:HttpGet(repo .. "addons/ThemeManager.lua"))() local ReplicatedStorage = game:GetService("ReplicatedStorage") local Players = game:GetService("Players") local HttpService = game:GetService("HttpService") local VirtualInputManager = game:GetService("VirtualInputManager") local Lighting = game:GetService("Lighting") local Remotes = ReplicatedStorage:WaitForChild("Remotes") local LocalPlayer = Players.LocalPlayer local UpgradeConfig = require(ReplicatedStorage:WaitForChild("Configs"):WaitForChild("UpgradeConfig")) local ChestConfig = require(ReplicatedStorage:WaitForChild("Configs"):WaitForChild("ChestConfig")) local CardConfig = require(ReplicatedStorage:WaitForChild("Configs"):WaitForChild("CardConfig")) local ClickRemote = Remotes:FindFirstChild("ClickElixir") local RequestUpgrade = Remotes:WaitForChild("RequestUpgrade") local RequestRebirth = Remotes:WaitForChild("RequestRebirth") local EquipCardRemote = Remotes:WaitForChild("EquipCard") local ChestStartUnlock = Remotes:WaitForChild("ChestStartUnlock") local ChestOpen = Remotes:WaitForChild("ChestOpen") local ChestSkip = Remotes:WaitForChild("ChestSkip") local ChestDeleteRemote = Remotes:WaitForChild("ChestDelete") local ChestFilterGet = Remotes:WaitForChild("ChestFilterGet") local ChestFilterSet = Remotes:WaitForChild("ChestFilterSet") local UsePotion = Remotes:WaitForChild("UsePotion") local State = { AutoClick = false, AutoEquipCard = false, AutoUsePotions = false, FPSBoost = false, SmartRebirth = false, SimpleUpgrade = false, AutoOpenChests = false, AutoUnlockSkip = false, InstantOpen = false } local ServerFilterState = {} local OriginalNotify = Library.Notify local function toggleFPSBoost(enable) if enable then Library.Notify = function() end local PlayerGui = LocalPlayer:FindFirstChild("PlayerGui") if PlayerGui then local mainGui = PlayerGui:FindFirstChild("mainGui") if mainGui then local rebirthReward = mainGui:FindFirstChild("rebirthingReward") if rebirthReward then rebirthReward.Visible = false end local intro = mainGui:FindFirstChild("Intro") if intro then intro.Visible = false end end end Lighting.GlobalShadows = false Lighting.FogEnd = 100000 Lighting.Brightness = 1 for _, effect in ipairs(Lighting:GetChildren()) do if effect:IsA("BlurEffect") or effect:IsA("BloomEffect") or effect:IsA("DepthOfFieldEffect") then effect.Enabled = false end end for _, desc in ipairs(workspace:GetDescendants()) do if desc:IsA("ParticleEmitter") or desc:IsA("Trail") or desc:IsA("Beam") then desc.Enabled = false elseif desc:IsA("Fire") or desc:IsA("Smoke") or desc:IsA("Sparkles") then desc.Enabled = false end end settings().Rendering.QualityLevel = Enum.QualityLevel.Level01 pcall(function() setfpscap(999) end) else Library.Notify = OriginalNotify Lighting.GlobalShadows = true for _, effect in ipairs(Lighting:GetChildren()) do if effect:IsA("BlurEffect") or effect:IsA("BloomEffect") or effect:IsA("DepthOfFieldEffect") then effect.Enabled = true end end settings().Rendering.QualityLevel = Enum.QualityLevel.Automatic end end local function equipBestCard() local CardsFolder = LocalPlayer:WaitForChild("Cards", 10) if not CardsFolder then return end local bestCard = nil local bestMultiplier = 0 for _, cardValue in ipairs(CardsFolder:GetChildren()) do if cardValue:IsA("IntValue") and cardValue.Value > 0 then local cardData = CardConfig[cardValue.Name] if cardData and cardData.ElixirMultiplier and cardData.ElixirMultiplier > bestMultiplier then bestMultiplier = cardData.ElixirMultiplier bestCard = cardValue.Name end end end if bestCard then pcall(function() EquipCardRemote:FireServer(bestCard) end) Library:Notify("Equipped " .. bestCard .. " (" .. bestMultiplier .. "x)", 3) end end local function getUpgradeInfo(upgrades, name) local levelVal = upgrades:FindFirstChild(name .. "Level") if not levelVal then return nil end local level = levelVal.Value local cost = UpgradeConfig.GetNextCost(name, level) local currentBonus = UpgradeConfig.GetBonus(name, level) local nextBonus = UpgradeConfig.GetBonus(name, level + 1) return { Name = name, Level = level, Cost = cost, CurrentBonus = currentBonus, NextBonus = nextBonus, Gain = nextBonus - currentBonus } end local function handleInstantOpen() local PlayerGui = LocalPlayer:FindFirstChild("PlayerGui") if not PlayerGui then return end local mainGui = PlayerGui:FindFirstChild("mainGui") if not mainGui then return end local openChestPage = mainGui:FindFirstChild("openChestPage") if openChestPage and openChestPage.Visible then local viewportSize = workspace.CurrentCamera.ViewportSize local x, y = viewportSize.X / 2, viewportSize.Y / 2 VirtualInputManager:SendMouseButtonEvent(x, y, 0, true, game, 1) task.wait(0.05) VirtualInputManager:SendMouseButtonEvent(x, y, 0, false, game, 1) end end local function runAutoClickLoop() while true do if State.AutoClick and ClickRemote then ClickRemote:FireServer() end task.wait() end end local function setChestFilter(chestType, enabled) local success, result = pcall(function() return ChestFilterSet:InvokeServer(chestType, enabled) end) if success and type(result) == "boolean" then ServerFilterState[chestType] = result return result end return nil end local function loadServerFilterState() local success, result = pcall(function() return ChestFilterGet:InvokeServer() end) if success and type(result) == "table" then ServerFilterState = result end return ServerFilterState end local function runAutoOpenLoop() while true do if State.AutoOpenChests then local ChestSlotsFolder = LocalPlayer:FindFirstChild("ChestSlots") if ChestSlotsFolder then local serverTimeOffset = LocalPlayer:GetAttribute("ServerTimeOffset") or 0 local currentTime = workspace:GetServerTimeNow() + serverTimeOffset for i = 1, 4 do local slot = ChestSlotsFolder:FindFirstChild("Slot" .. i) if slot then local state = slot:FindFirstChild("State") local unlockTime = slot:FindFirstChild("UnlockEndTime") if state and state.Value == "Unlocking" and unlockTime and currentTime >= unlockTime.Value then ChestOpen:FireServer(i) end end end end end task.wait() end end local function runAutoUnlockSkipLoop() while true do if State.AutoUnlockSkip then local ChestSlotsFolder = LocalPlayer:FindFirstChild("ChestSlots") local ElixirVal = LocalPlayer:FindFirstChild("Elixir") if ChestSlotsFolder and ElixirVal then for i = 1, 4 do local slot = ChestSlotsFolder:FindFirstChild("Slot" .. i) if slot then local chestNameVal = slot:FindFirstChild("ChestName") local stateVal = slot:FindFirstChild("State") if chestNameVal and stateVal then local chestName = chestNameVal.Value local state = stateVal.Value if chestName ~= "" then if state == "Locked" then ChestStartUnlock:FireServer(i) Library:Notify("Started unlocking " .. chestName .. " Chest", 2) task.wait(0.5) elseif state == "Unlocking" then local chestData = ChestConfig.Types[chestName] if chestData and chestData.SkipCost and ElixirVal.Value >= chestData.SkipCost then ChestSkip:FireServer(i) Library:Notify("Skipped " .. chestName .. " Chest", 2) task.wait(0.5) end end end end end end end end task.wait(1) end end local function runInstantOpenLoop() while true do if State.InstantOpen then pcall(handleInstantOpen) end task.wait(0.1) end end local function runUpgradeRebirthLoop() while true do local Upgrades = LocalPlayer:FindFirstChild("Upgrades") local RebirthsVal = LocalPlayer:FindFirstChild("Rebirths") local ElixirVal = LocalPlayer:FindFirstChild("Elixir") if Upgrades and RebirthsVal and ElixirVal then local currentElixir = ElixirVal.Value local rebirthCount = RebirthsVal.Value local rebirthCost = math.max(100000, math.floor(100000 * 1.5 ^ rebirthCount)) if State.SmartRebirth then if currentElixir >= rebirthCost then RequestRebirth:FireServer() Library:Notify("Smart Rebirth!", 2) task.wait(1) else local acsLevelVal = Upgrades:FindFirstChild("AutoClickerSpeedLevel") local currentACSLevel = acsLevelVal and acsLevelVal.Value or 0 local currentInterval = UpgradeConfig.GetAutoClickerInterval(nil, currentACSLevel) local currentCPS = 1 / currentInterval local totalCPS = 15 + currentCPS local cpInfo = getUpgradeInfo(Upgrades, "ClickPower") local epsInfo = getUpgradeInfo(Upgrades, "ElixirPerSecond") local acsInfo = getUpgradeInfo(Upgrades, "AutoClickerSpeed") if cpInfo and epsInfo and acsInfo then local currentRate = math.max(1, epsInfo.CurrentBonus + (cpInfo.CurrentBonus * totalCPS)) local t_cp = math.huge if currentElixir >= cpInfo.Cost then local newRate = currentRate + (cpInfo.Gain * totalCPS) t_cp = (rebirthCost - (currentElixir - cpInfo.Cost)) / newRate end local t_eps = math.huge if currentElixir >= epsInfo.Cost then local newRate = currentRate + epsInfo.Gain t_eps = (rebirthCost - (currentElixir - epsInfo.Cost)) / newRate end local t_acs = math.huge if currentElixir >= acsInfo.Cost then local nextInterval = UpgradeConfig.GetAutoClickerInterval(nil, currentACSLevel + 1) local nextCPS = 1 / nextInterval local nextTotalCPS = 15 + nextCPS local newRate = epsInfo.CurrentBonus + (cpInfo.CurrentBonus * nextTotalCPS) t_acs = (rebirthCost - (currentElixir - acsInfo.Cost)) / newRate end local bestTime = (rebirthCost - currentElixir) / currentRate local toBuy = nil if t_cp < bestTime then bestTime, toBuy = t_cp, "ClickPower" end if t_eps < bestTime then bestTime, toBuy = t_eps, "ElixirPerSecond" end if t_acs < bestTime then bestTime, toBuy = t_acs, "AutoClickerSpeed" end if toBuy then RequestUpgrade:FireServer(toBuy) task.wait(0.1) end end end elseif State.SimpleUpgrade then if currentElixir >= rebirthCost then RequestRebirth:FireServer() Library:Notify("Rebirth!", 2) task.wait(1) else local upgradesToCheck = {"ClickPower", "ElixirPerSecond", "AutoClickerSpeed"} local cheapest = math.huge local buyTarget = nil for _, u in ipairs(upgradesToCheck) do local info = getUpgradeInfo(Upgrades, u) if info and info.Cost < cheapest then cheapest = info.Cost buyTarget = u end end if buyTarget and currentElixir >= cheapest then RequestUpgrade:FireServer(buyTarget) task.wait(0.1) end end end end task.wait(0.25) end end local function runAutoPotionsLoop() while true do if State.AutoUsePotions then local Potions = LocalPlayer:FindFirstChild("Potions") if Potions then local elixirExpire = LocalPlayer:GetAttribute("ElixirPotionExpireAt") or 0 local elixirCount = Potions:FindFirstChild("ElixirCount") if elixirCount and elixirCount.Value > 0 and os.time() >= elixirExpire then pcall(function() UsePotion:InvokeServer("Elixir") end) Library:Notify("Used Elixir Potion", 2) end local luckExpire = LocalPlayer:GetAttribute("LuckPotionExpireAt") or 0 local luckCount = Potions:FindFirstChild("LuckCount") if luckCount and luckCount.Value > 0 and os.time() >= luckExpire then pcall(function() UsePotion:InvokeServer("Luck") end) Library:Notify("Used Luck Potion", 2) end end end task.wait(5) end end local Window = Library:CreateWindow({ Name = "Clash RNG | Advanced", Themeable = { Info = "Made by Antigravity" } }) local Tabs = { Main = Window:AddTab("Main", "star"), Chests = Window:AddTab("Chests", "package"), Settings = Window:AddTab("Settings", "settings"), } local AutomationGroup = Tabs.Main:AddLeftGroupbox("Automation") local UpgradeGroup = Tabs.Main:AddRightGroupbox("Upgrades") AutomationGroup:AddToggle("AutoClick", { Text = "Auto Click", Default = false, Callback = function(Value) State.AutoClick = Value end }) AutomationGroup:AddToggle("AutoEquipCard", { Text = "Auto Equip Best Card", Default = false, Callback = function(Value) State.AutoEquipCard = Value if Value then task.spawn(equipBestCard) end end }) AutomationGroup:AddToggle("AutoUsePotions", { Text = "Auto Use Potions", Default = false, Callback = function(Value) State.AutoUsePotions = Value end }) AutomationGroup:AddToggle("FPSBoost", { Text = "FPS Boost", Default = false, Callback = function(Value) State.FPSBoost = Value toggleFPSBoost(Value) end }) UpgradeGroup:AddToggle("SmartRebirth", { Text = "Smart Auto Rebirth (ROI)", Default = false, Callback = function(Value) State.SmartRebirth = Value if Value then State.SimpleUpgrade = false end end }) UpgradeGroup:AddToggle("AutoUpgrade", { Text = "Simple Auto Upgrade", Default = false, Callback = function(Value) State.SimpleUpgrade = Value if Value then State.SmartRebirth = false end end }) local ChestManagerGroup = Tabs.Chests:AddLeftGroupbox("Manager") local ChestFilterGroup = Tabs.Chests:AddRightGroupbox("Delete Filter") ChestManagerGroup:AddToggle("AutoOpenChests", { Text = "Auto Open Ready Chests", Default = false, Callback = function(Value) State.AutoOpenChests = Value end }) ChestManagerGroup:AddToggle("AutoUnlockSkip", { Text = "Auto Unlock & Skip (Elixir)", Default = false, Callback = function(Value) State.AutoUnlockSkip = Value end }) ChestManagerGroup:AddToggle("InstantOpen", { Text = "Instant Open Animation", Default = false, Callback = function(Value) State.InstantOpen = Value end }) local ChestTypes = {} if ChestConfig and ChestConfig.Types then for chestName, _ in pairs(ChestConfig.Types) do table.insert(ChestTypes, chestName) end table.sort(ChestTypes, function(a, b) local tierA = (ChestConfig.RarityTier and ChestConfig.RarityTier[a]) or -1 local tierB = (ChestConfig.RarityTier and ChestConfig.RarityTier[b]) or -1 if tierA ~= tierB then return tierA < tierB end return a < b end) end loadServerFilterState() local FilterToggles = {} for _, chestType in ipairs(ChestTypes) do local defaultValue = ServerFilterState[chestType] == true FilterToggles[chestType] = ChestFilterGroup:AddToggle("Filter_" .. chestType, { Text = chestType, Default = defaultValue, Callback = function(Value) local result = setChestFilter(chestType, Value) if result ~= nil then Library:Notify((result and "Filtering" or "Unfiltered") .. " " .. chestType .. " Chests", 2) end end }) end ThemeManager:SetLibrary(Library) ThemeManager:ApplyToTab(Tabs.Settings) task.spawn(runAutoClickLoop) task.spawn(runAutoOpenLoop) task.spawn(runAutoUnlockSkipLoop) task.spawn(runInstantOpenLoop) task.spawn(runUpgradeRebirthLoop) task.spawn(runAutoPotionsLoop) Library:SetWatermarkVisibility(true) Library:Notify("Loaded", 3)