mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-18 12:11:54 +00:00
More camera, might deprecate the custom camera
This commit is contained in:
35
src/client/Character/Client/LocalTransparencyModifier.lua
Normal file
35
src/client/Character/Client/LocalTransparencyModifier.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
--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
|
||||
Reference in New Issue
Block a user