Okay so, I’m making a custom weapon system.
The players can press V to toggle First Person.
The problem is that whenever the player comes back from FPS. Their character, becomes translucent till they unequip the weapon.
After unequipping it goes back to the normal.
When I check the part’s transparency it shows 0.
I have alot of code, and not sure which one to show. So i’ll just show the part that converts to fps.
local fpsdb = true
function module.goandungofps(viewmodel,char,class)
if reloading then return end
if fpsdb then
fpsdb = false
if class == 'gofps' then
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
viewmodel.Parent = game.Workspace.Camera
module.weldwithgun(game.ReplicatedStorage[char:FindFirstChildWhichIsA("Tool").Name],viewmodel)
module.equip(viewmodel,game.Workspace.Camera.Viewmodel[char:FindFirstChildWhichIsA("Tool").Name],game.ReplicatedStorage.GunAnimations.PistolHold,game.ReplicatedStorage.GunAnimations.PistolEquip)
elseif class == 'ungo' then
game.Workspace.Camera.Viewmodel[char:FindFirstChildWhichIsA("Tool").Name].Parent = game.ReplicatedStorage
viewmodel.Parent =game.ReplicatedStorage
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
end
wait(1)
fpsdb = true
end
end
If you’d like more code. Then please reply.