So in my game, I set the camera mode to lockfirstperson and set max and min zoom distances to 0.5 . However, I want the camera to zoom out when the player dies to about 20(..zoom units?). Here's the script I made.
local Player = game.Players.LocalPlayer
local character = Player.CharacterAdded:wait() ; Character = Player.Character
local hum = char:WaitForChild("Humanoid")
game:GetService('Players').PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").Died:Connect(function()
game.StarterPlayer.CameraMaxZoomDistance = 20
game.StarterPlayer.CameraMode = Classic
end)
end
However, nothing happens. It doesn't zoom out, it doesn't reset, nothing. Please fix my script and tell me what I did wrong.
