Hello everyone, I’m making a script for a first-person camera and using a Scriptable camera since I myself prescribed the movement in the script that I need, but there is a problem that I can’t figure out how to remove it.
My function is for transparency of body parts and accessories:
local function updateTransparencyOnce()
if v1.dead then
for _, part in pairs(v1.char:GetDescendants()) do
if part:IsA("BasePart") then
part.LocalTransparencyModifier = 0
end
end
else
for _, part in pairs(v1.char:GetDescendants()) do
if part:IsA("BasePart") then
part.LocalTransparencyModifier = 1
if not (
part.Parent ~= v1.char and
not part:FindFirstAncestorOfClass("Tool") and
(not part:FindFirstAncestorOfClass("Model") or not part:FindFirstAncestorOfClass("Model"):GetAttribute("ShowInFirstPerson")) and
not part:FindFirstAncestor("OffhandHandle") and
part.Name ~= "OffhandHandle"
) or (
part:FindFirstChildOfClass("WrapLayer") and
part:FindFirstChild("FaceFrontAttachment") == nil and
part:FindFirstChild("FaceCenterAttachment") == nil and
part:FindFirstChild("HairAttachment") == nil and
part:FindFirstChild("HatAttachment") == nil and
part:FindFirstChild("NeckRigAttachment") == nil and
part.Parent:GetAttribute("HideInFirstPerson") ~= true
) then
if not (part.Name ~= "Torso") or part.Name == "Head" then
part.LocalTransparencyModifier = 1
else
part.LocalTransparencyModifier = 0
end
end
end
end
end
end
updateTransparencyOnce()
It works, but it’s in roblox player, not in the studio, that it causes a bunch of errors related to the main roblox script, which is responsible for the character…
don’t forget that I use camera.CameraType = Enum.CameraType.Scriptable because there may be an error due to this, but I do not know how to fix it in this mode. I have tried many methods but I have not been able to find a solution.