-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearchQuery.lua
More file actions
60 lines (36 loc) · 1.63 KB
/
searchQuery.lua
File metadata and controls
60 lines (36 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
-- 'name=hi & classname=part'
function checkByPrompt(inst:Part,prompt:string)
local fillters = string.split(prompt,'&')
for i,v in fillters do
local eq = true
local tempFilter = v
if string.find(tempFilter,'!=') ~= nil then
eq = false
tempFilter = string.gsub(tempFilter,'!=','=')
end
if string.lower(string.split(tempFilter,'=')[1]) == 'name' then
if (inst.Name == string.split(tempFilter,'=')[2]) ~= eq then return false end
elseif string.lower(string.split(tempFilter,'=')[1]) == 'classname' then
if (inst.ClassName == string.split(tempFilter,'=')[2]) ~= eq then return false end
elseif string.lower(string.split(tempFilter,'=')[1]) == 'parentname' then
if (inst.Parent.Name == string.split(tempFilter,'=')[2]) ~= eq then return false end
elseif string.lower(string.split(tempFilter,'=')[1]) == 'parentclassname' then
if (inst.Parent.ClassName == string.split(tempFilter,'=')[2]) ~= eq then return false end
elseif string.lower(string.split(tempFilter,'=')[1]) == 'transparency' then
if (inst.Transparency == tonumber(string.split(tempFilter,'=')[2])) ~= eq then return false end
elseif string.lower(tempFilter) == 'enabled' then
if (inst.Enabled == false) then return false end
elseif string.lower(tempFilter) == '!enabled' then
if (inst.Enabled == true) then return false end
end
end
return true
end
local t1 = tick()
for i,v in ipairs(game:GetDescendants()) do
if checkByPrompt(v,'classname=LocalScript') then
print(v)
end
end
print(tick()-t1)
--print(checkByPrompt(workspace.Baseplate,'parentName=Workspace&classname=Part&transparency=0'))