Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to Make Tools Move With The Y axis?

Asked by 3 years ago

I've tried to look all over for a working script for r6 or r15 but I haven't found one. This is a code that came close to working, but when you die it goes back to normal first person. Can anyone help me fix this code so it works or make a new code that works? (this code only works with r6, but id be fine with r6 or r15).

plr = game.Players.LocalPlayer; -- local script
repeat wait() until plr.Character
char = plr.Character
m = plr:GetMouse()
game["Run Service"].RenderStepped:connect(function()
    local c = game.Workspace.CurrentCamera

    char.HumanoidRootPart["RootJoint"].C0 = CFrame.new(0,0,0) * CFrame.Angles(-math.asin((m.Origin.p - m.Hit.p).unit.y) + 1.55,3.15,0)

    char.Humanoid.CameraOffset = (char.HumanoidRootPart.CFrame+Vector3.new(0,0,0)):pointToObjectSpace(char.Head.CFrame.p + Vector3.new(0,-1.46,0))

end)

Answer this question