Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- localscript inside of playerstarterscripts
- local value = 10 -- edit to do height
- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
- local camera = game.Workspace.CurrentCamera
- repeat wait() until player.Character
- camera.CameraType = Enum.CameraType.Scriptable
- camera.CoordinateFrame = CFrame.new(player.Character:WaitForChild("Torso").CFrame.p + Vector3.new(0, value, 0), player.Character:WaitForChild("Torso").CFrame.p)
- mouse.Move:connect(function()
- local character = player.Character
- if character then
- local torso = character:WaitForChild("Torso")
- local pos = mouse.Hit.p
- local head = character:WaitForChild("Head")
- character:WaitForChild("Humanoid").AutoRotate = false
- torso.CFrame = CFrame.new(torso.CFrame.p, Vector3.new(pos.X, torso.CFrame.p.Y, pos.Z))
- --[[local neck = torso:FindFirstChild("Neck")
- if neck then
- neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(-math.asin((mouse.Origin.p - mouse.Hit.p).unit.y) + 1.55,3.15,0)
- end]]--
- end
- end)
- while wait() do
- if player.Character then
- local torso = player.Character:WaitForChild("Torso")
- camera:Interpolate(CFrame.new(torso.CFrame.p + Vector3.new(0, value, 0)), torso.CFrame, .1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement