This repository was archived by the owner on Dec 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHide.lua
More file actions
52 lines (46 loc) · 1.24 KB
/
Hide.lua
File metadata and controls
52 lines (46 loc) · 1.24 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
local Cache = {}
local Hide = function(...)
Cache = {}
local HideFunction = function(Ins)
if Ins:IsA("BasePart") then
Cache[Ins] = {["Transparency"] = Ins.Transparency,["CanCollide"] = Ins.CanCollide}
Ins.Transparency = 1
Ins.CanCollide = false
elseif Ins:IsA("FaceInstance") then
Cache[Ins] = {["Transparency"] = Ins.Transparency}
Ins.Transparency = 1
elseif Ins:IsA("RopeConstraint") then
Cache[Ins] = {["Enabled"] = Ins.Enabled,["Visible"] = Ins.Visible}
Ins.Enabled = false
Ins.Visible = false
elseif Ins:IsA("GuiObject") then
Cache[Ins] = {["Visible"] = Ins.Visible}
Ins.Visible = false
elseif Ins:IsA("LayerCollector") then
Cache[Ins] = {["Enabled"] = Ins.Enabled}
Ins.Enabled = false
elseif Ins:IsA("Light") then
Cache[Ins] = {["Enabled"] = Ins.Enabled}
Ins.Enabled = true
elseif Ins:IsA("Sound") then
Cache[Ins] = {["Playing" = Ins.Playing]}
Ins:Stop()
end
end
for Index, Ins in pairs({...}) do
HideFunction(Ins)
for Index, Des in pairs(Ins:GetDescendants()) do
HideFunction(Des)
end
end
end
local UnHide = function()
for Ins, Table in pairs(Cache) do
if Ins ~= nil then
for Property, Value in pairs(Table) do
Ins[Property] = Value
end
end
end
Cache = {}
end