I am trying to make a custom camera be activated when entering a store and then get disabled when leaving. I can activate the custom camera but then I can’t change the camera type back to custom even after disabling the custom camera script. I’ve looked around for some solutions but nothing that I’ve tried has worked.
The code that does this is a script in a door that gets activated by a Proximity Prompt.
script.Parent.Triggered:Connect(function(plr)
local fade = plr.PlayerGui.fade.Frame
local text = plr.PlayerGui.fade.Frame.TextLabel
local loading = plr.PlayerGui.fade.Frame.load
while fade.Transparency > 0 do
fade.Transparency -= 0.05
text.TextTransparency -= 0.05
loading.ImageTransparency -= 0.05
wait(0.01)
end
plr.Character.HumanoidRootPart.CFrame = CFrame.new(workspace.tpUpgradesOut.Position)
game.Workspace[plr.Name].LocalScript.Disabled = true
local cam = game.Workspace.Camera
cam.CameraType = Enum.CameraType.Custom
wait(0.5)
while fade.Transparency < 1 do
fade.Transparency += 0.05
text.TextTransparency += 0.05
loading.ImageTransparency += 0.05
wait(0.01)
end
end)
Whatever is being done in this script stops because it disables the script before going back to custom so it shouldn’t be changing it back to scriptable.