I want to show the Player’s body even when zooming into first person and it doesn’t work or error
I have tried using a while true loop and while (if true) do loop, both didn’t work
My script:
-- initialize local variables
local Camera = workspace.CurrentCamera
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character.Humanoid
local CameraZoomDistance = tonumber(string.sub((Camera.CFrame.Position - Camera.Focus.Position).Magnitude, 1, 3))
-- if the Player steps in a vehicle
Camera:GetPropertyChangedSignal("CameraSubject"):Connect(function()
if Camera.CameraSubject:IsA("VehicleSeat") or Camera.CameraSubject:IsA("Seat") then
Camera.CameraSubject = Humanoid
end
end)
-- set and keep every body part Transparency to its real transparency
if CameraZoomDistance <= .5 then -- Do this while it is in first person
while true do
Humanoid.CameraOffset = Vector3.new(0, 0, -1)
Camera.FieldOfView = 100
for childIndex, child in pairs(Character:GetChildren()) do
if child:IsA("BasePart") and child.Name ~= "Head" then
child:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
child.LocalTransparencyModifier = child.Transparency
end)
child.LocalTransparencyModifier = child.Transparency
end
end
end
else -- if you are not in fp
Camera.FieldOfView = 70
Humanoid.CameraOffset = Vector3.new(0, 0, 0)
end
I can’t figure out what I did wrong and would be happy to recive help and learn
![]()