Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local CoreGui = game:GetService("CoreGui");
- local DexDependencies = {
- Frame = 14,
- LocalScript = 1,
- ImageButton = 1,
- }
- local CertaintyLevel = 0.8
- local DependencyLevel = 0.8
- function TableContainsInstance(Table, Instance)
- for _, Value in next, Table do
- if (Value == Instance.Name) then
- return true
- end
- end
- return false
- end
- function FindGuiInstancesWithIgnoreList(IgnoreList)
- local IgnoreList = IgnoreList or {};
- local Instances = {};
- table.foreach(CoreGui:GetChildren(), function(_, Child)
- local IsRobloxGui = TableContainsInstance(IgnoreList, Child)
- if not IsRobloxGui then
- table.insert(Instances, Child)
- end
- end)
- return Instances
- end
- function DeleteDex()
- local PotentialDexInstances = FindGuiInstancesWithIgnoreList({
- "RobloxGui",
- "CoreScriptLocalization",
- "RobloxPromptGui",
- "PurchasePromptApp",
- "RobloxNetworkPauseNotification",
- "TopBar",
- "DevConsoleMaster",
- "RobloxLoadingGui"
- })
- for _, Candidate in next, PotentialDexInstances do
- if Candidate:IsA("ScreenGui") then
- local DependencyTarget = 0
- local DependenciesMet = 0
- for Dependency, Target in next, DexDependencies do
- local Count = 0
- for _, Child in next, Candidate:GetChildren() do
- if Child:IsA(Dependency) then
- Count = Count + 1
- end
- end
- if ((Count / Target) >= DependencyLevel) then
- DependenciesMet = DependenciesMet + 1
- end
- DependencyTarget = DependencyTarget + 1
- end
- local Certainty = DependenciesMet / DependencyTarget
- if (Certainty >= CertaintyLevel) then
- print(Candidate, "is Dex. Removing now.")
- Candidate:Destroy();
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement