Files
Roblox-Elevator-Game/src/client/Character/Client/LocalTransparencyModifier.lua

35 lines
720 B
Lua

--Heh, i copied and pasted this from Character/Server/Shadows.lua
local LTM = {}
LTM.__index = LTM
type Character = Model
function LTM.constructor(Character: Character)
return setmetatable({
Character = Character
}, LTM)
end
function LTM:PartToggle(Instance: BasePart, Visible: boolean)
if Instance:IsA("BasePart") then
Instance.LocalTransparencyModifier = Visible and 0 or 1
end
end
local function CharacterLTM(self, enabled: boolean)
local CharacterDescendants = self.Character:GetDescendants()
for i = 1, #CharacterDescendants do
self:PartToggle(CharacterDescendants[i], enabled)
end
end
function LTM:on()
CharacterLTM(self, true)
end
function LTM:off()
CharacterLTM(self, false)
end
return LTM