Skip to content

Commit a67ac13

Browse files
authored
Add files via upload
1 parent e873d60 commit a67ac13

1 file changed

Lines changed: 177 additions & 0 deletions

File tree

GetScan.luau

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
--[[
2+
============================================================================
3+
GET-SCAN PROPRIETARY SOURCE LICENSE (DPSL-1.0)
4+
Copyright © 2026 Daichi (@DaichiAlt_kage/4076266120) / Heavenly Creation. All Rights Reserved.
5+
============================================================================
6+
7+
[ 1. ACCEPTANCE OF TERMS ]
8+
BY ACCESSING, COPYING, INSTALLING, OR OTHERWISE USING THIS SOFTWARE, YOU
9+
AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. IF YOU DO NOT AGREE TO
10+
THESE TERMS, YOU ARE NOT PERMITTED TO USE THE SOFTWARE AND MUST DELETE
11+
ALL COPIES IMMEDIATELY.
12+
13+
[ 2. GRANT OF LICENSE ]
14+
Subject to the terms and conditions of this License, the Licensor hereby
15+
grants you a non-exclusive, non-transferable, royalty-free license to
16+
use, modify, and integrate this Software into private, non-commercial
17+
projects within the Roblox platform.
18+
19+
[ 3. RESTRICTIONS ]
20+
3.1 NON-COMMERCIAL USE ONLY: You may not sell, rent, lease, or otherwise
21+
commercialize this Software or any derivative works.
22+
3.2 PROHIBITION ON REDISTRIBUTION: You may not redistribute this Software
23+
as a standalone product, library, or plugin on any public marketplace
24+
or repository for profit or as your own work.
25+
3.3 PROHIBITION ON PLAGIARISM: You may not remove, obscure, or alter
26+
any copyright notices or identification of the Licensor (Daichi)
27+
contained within the Software.
28+
29+
[ 4. DERIVATIVE WORKS & ATTRIBUTION ]
30+
You may create derivative works based on this Software for private use.
31+
However, any such derivative work that is shared or distributed must
32+
prominently credit "Daichi" as the original author of the underlying
33+
architecture and logic.
34+
35+
[ 5. NO VIRAL REQUIREMENT ]
36+
The use of this Software in your project does not require you to
37+
release your own project’s source code under this or any other license.
38+
Your original logic remains your proprietary property.
39+
40+
[ 6. DISCLAIMER OF WARRANTY ]
41+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
42+
OR IMPLIED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM,
43+
DAMAGES, OR OTHER LIABILITY ARISING FROM THE USE OF THIS SOFTWARE.
44+
45+
============================================================================
46+
]]
47+
local GetScan = {}
48+
local Dictionary = require(script.Dictionary)
49+
50+
-- [ SETTINGS ] --
51+
local DEBUG_MODE = false
52+
53+
-- [ INTERNAL STORAGE ] --
54+
local ClassMap = {}
55+
56+
-- [ PRIVATE UTILITIES ] --
57+
local function Log(msg)
58+
if DEBUG_MODE then print("? [GetScan]: " .. msg) end
59+
end
60+
61+
local function Warn(msg)
62+
if DEBUG_MODE then warn("? [GetScan]: " .. msg) end
63+
end
64+
65+
-- [ PROXY BUILT-IN METHODS ] --
66+
-- These are "Special" functions you can call on any Scanned Proxy.
67+
local ProxyMethods = {
68+
-- Returns a table: [HexID] = CurrentValue
69+
Serialize = function(proxy)
70+
local instance = proxy() -- Unwrap via __call
71+
local allowed = ClassMap[instance.ClassName]
72+
local data = {}
73+
for propName, hexID in pairs(allowed) do
74+
data[hexID] = instance[propName]
75+
end
76+
return data
77+
end,
78+
79+
-- Returns the HexID for a specific property name
80+
GetPropHex = function(proxy, propName)
81+
local instance = proxy()
82+
return ClassMap[instance.ClassName][propName]
83+
end
84+
}
85+
86+
-- [ THE UNIFIED SCANNER ] --
87+
function GetScan.Scan(instance)
88+
if not instance then return Warn("Scan failed: Instance is nil.") end
89+
90+
local className = instance.ClassName
91+
local startClock = os.clock()
92+
93+
-- 1. DISCOVERY PHASE (Discovery Tax: Paid once per Class)
94+
if not ClassMap[className] then
95+
Log("Initiating Scan for Class '" .. className .. "'...")
96+
local validProperties = {}
97+
local count = 0
98+
99+
for propName, hexID in pairs(Dictionary) do
100+
local success = pcall(function() return instance[propName] end)
101+
if success then
102+
validProperties[propName] = hexID
103+
count += 1
104+
end
105+
end
106+
107+
ClassMap[className] = validProperties
108+
local duration = math.floor((os.clock() - startClock) * 1000)
109+
Log("Scan Complete: Found " .. count .. " properties in " .. duration .. "ms.")
110+
end
111+
112+
-- 2. THE LUAU+ PROXY
113+
local allowed = ClassMap[className]
114+
local proxy = {}
115+
116+
return setmetatable(proxy, {
117+
__index = function(_, key)
118+
-- Check if we are calling a Proxy Method (Serialize, etc.)
119+
if ProxyMethods[key] then
120+
return function(...) return ProxyMethods[key](proxy, ...) end
121+
end
122+
123+
-- Check if it's a valid Roblox property
124+
if allowed[key] then
125+
return instance[key]
126+
end
127+
128+
Warn("Property Access Denied: '" .. tostring(key) .. "' is not valid for " .. className)
129+
return nil
130+
end,
131+
132+
__newindex = function(_, key, value)
133+
if allowed[key] then
134+
instance[key] = value
135+
else
136+
Warn("Modification Denied: Cannot set '" .. tostring(key) .. "' on " .. className)
137+
end
138+
end,
139+
140+
__call = function() return instance end,
141+
__tostring = function() return "Dictionary<" .. className .. ">(" .. instance.Name .. ")" end
142+
})
143+
end
144+
145+
-- [ RECURSIVE DEEP SCAN ] --
146+
-- Scans an object and all its children, returning a table of Proxies.
147+
function GetScan.ScanDeep(root)
148+
if not root then return {} end
149+
local hierarchy = {}
150+
151+
-- Scan the root object
152+
hierarchy[root.Name] = GetScan.Scan(root)
153+
154+
-- Scan all descendants
155+
for _, item in ipairs(root:GetDescendants()) do
156+
-- Only scan things that are real engine objects (not scripts/folders usually)
157+
if item:IsA("BasePart") or item:IsA("Humanoid") or item:IsA("DataModelMesh") then
158+
hierarchy[item.Name] = GetScan.Scan(item)
159+
end
160+
end
161+
162+
Log("Deep Scan Complete for '" .. root.Name .. "'.")
163+
return hierarchy
164+
end
165+
166+
-- [ GLOBAL UTILITIES ] --
167+
function GetScan.SetDebug(state)
168+
DEBUG_MODE = state
169+
print("[GetScan]: Debug Mode set to " .. tostring(state))
170+
end
171+
172+
function GetScan.FlushCache()
173+
ClassMap = {}
174+
Log("Internal ClassMap Cache cleared.")
175+
end
176+
177+
return GetScan

0 commit comments

Comments
 (0)