Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- makes sure to keep this in startercharacterscripts
- -- credits to noobieYT
- local character = script.Parent
- local humanoid = character:WaitForChild("Humanoid")
- local camera = workspace.CurrentCamera
- local UserInputService = game:GetService("UserInputService")
- local TweenService = game:GetService("TweenService")
- local TweenInformation = TweenInfo.new(
- .25,
- Enum.EasingStyle.Sine,
- Enum.EasingDirection.InOut
- )
- local Right = Vector3.new(5, 0, 0)
- local Left = Vector3.new(-5, 0, 0)
- local Middle = Vector3.new(0, 0, 0)
- local Zoompov = 50
- local normalpov = 70
- UserInputService.InputBegan:Connect(function(Key, GPS)
- if Key.KeyCode == Enum.KeyCode.E and not GPS then
- TweenService:Create(humanoid, TweenInformation, {CameraOffset = Right}):Play()
- TweenService:Create(camera, TweenInformation, {FieldOfView = Zoompov}):Play()
- elseif Key.KeyCode == Enum.KeyCode.Q and not GPS then
- TweenService:Create(humanoid, TweenInformation, {CameraOffset = Left}):Play()
- TweenService:Create(camera, TweenInformation, {FieldOfView = Zoompov}):Play()
- end
- end)
- UserInputService.InputEnded:Connect(function(key)
- if key.KeyCode == Enum.KeyCode.E or key.KeyCode == Enum.KeyCode.Q then
- TweenService:Create(humanoid, TweenInformation, {CameraOffset = Middle}):Play()
- TweenService:Create(camera, TweenInformation, {FieldOfView = normalpov}):Play()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement