Advertisement
Guest User

Untitled

a guest
Nov 29th, 2015
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.24 KB | None | 0 0
  1. -- localscript inside of playerstarterscripts
  2.  
  3. local value = 10 -- edit to do height
  4.  
  5. local player = game.Players.LocalPlayer
  6. local mouse = player:GetMouse()
  7. local camera = game.Workspace.CurrentCamera
  8.  
  9. repeat wait() until player.Character
  10. camera.CameraType = Enum.CameraType.Scriptable
  11. camera.CoordinateFrame = CFrame.new(player.Character:WaitForChild("Torso").CFrame.p + Vector3.new(0, value, 0), player.Character:WaitForChild("Torso").CFrame.p)
  12.  
  13. mouse.Move:connect(function()
  14.         local character = player.Character
  15.         if character then
  16.             local torso = character:WaitForChild("Torso")
  17.             local pos = mouse.Hit.p
  18.             local head = character:WaitForChild("Head")
  19.             character:WaitForChild("Humanoid").AutoRotate = false
  20.             torso.CFrame = CFrame.new(torso.CFrame.p, Vector3.new(pos.X, torso.CFrame.p.Y, pos.Z))
  21.             --[[local neck = torso:FindFirstChild("Neck")
  22.             if neck then
  23.                 neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(-math.asin((mouse.Origin.p - mouse.Hit.p).unit.y) + 1.55,3.15,0)                       
  24.             end]]--
  25.         end
  26. end)
  27.  
  28. while wait() do
  29.     if player.Character then
  30.         local torso = player.Character:WaitForChild("Torso")
  31.         camera:Interpolate(CFrame.new(torso.CFrame.p + Vector3.new(0, value, 0)), torso.CFrame, .1)
  32.     end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement