So basically, I have this script where it changes your camera position for the gun to look cool, right? So it changes the camera to this:
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local plr = game:GetService("Players").LocalPlayer
local char = script.Parent.Parent
local hum = char:WaitForChild("Humanoid")
local root = hum.RootPart
hum.AutoRotate = false
game.StarterPlayer.CameraMaxZoomDistance = 7
game.StarterPlayer.CameraMinZoomDistance = 3.5
hum.CameraOffset = Vector3.new(3.00,1.00,0)
game:GetService("RunService"):BindToRenderStep("ShiftLock", Enum.RenderPriority.Character.Value, function()
game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter
local _, y = workspace.CurrentCamera.CFrame.Rotation:ToEulerAnglesYXZ()
root.CFrame = CFrame.new(root.Position) * CFrame.Angles(0,y,0)
end)
And now I try change it back to normal, I have no idea how
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local plr = game:GetService("Players").LocalPlayer
local char = script.Parent.Parent
local hum = char:WaitForChild("Humanoid")
local root = hum.RootPart
hum.AutoRotate = true
game.StarterPlayer.CameraMaxZoomDistance = 20
game.StarterPlayer.CameraMinZoomDistance = 3.5
hum.CameraOffset = Vector3.new(0,0,0)
game:GetService("RunService"):BindToRenderStep("ShiftLock", Enum.RenderPriority.Character.Value, function()
game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.Default
local _, y = workspace.CurrentCamera.CFrame.Rotation:ToEulerAnglesYXZ()
root.CFrame = CFrame.new(root.Position) * CFrame.Angles(0,y,0)
end)