How do i make players arms move up and down with mouse

  1. What do you want to achieve?
    I want to make players arms move up and down following the mouse while holding tools
    like in: Randomizer, Weaponry and Neighborhood war

  2. What is the issue?
    I couldn’t find / couldn’t understand any tutorials that i found

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I looked on: YouTube, DevForum and even on the second page of a google search

edit:
i managed to make something with the help of @benpinpop but i still couldn’t get it to be the way i need it to be

script:

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()

repeat wait() until Player.Character:FindFirstChild("Humanoid")

while true do
	wait()
	if math.rad(Mouse.Y) >= 2.5 and math.rad(Mouse.Y) <= 6.5 then
		Player.Character.Torso["Right Shoulder"].C1 = CFrame.Angles(0,0,math.rad(Mouse.Y))			
	end	
	print(math.rad(Mouse.Y))
end

also i forgot to say that i need it to be r6

Okay, you need a local script.

local Mouse = game.Players.LocalPlayer:GetMouse()

Then you use mouse.Y to check the vertical position on screen.

Then you do Math to multiply the X position to change arms Z (x,y,z) orientation depending on mouse.Y. You can check if the mouse position is within your limits. (If you want.) Since GetMouse is client sided, you’ll need a remote event to contact the server to change the arm position.

if calculatedPostion <= 70 and calculatedposition >= 0 then
 --move arm
end

example of limits above ^

Oh frick. just realized you don’t know how to script, gimme a sec to try to find tutorial.

I don’t know where you got it from but I can script

Oh sorry, you said you were looking for a tutorial and I assumed you didn’t know how to script. My bad, wrong assumption.

okay but how do i actually rotate the arm to the position?

i have a script that does exactly that
heres an example of how it works for the right arm:

it works by sending

thecframe = CFrame.lookAt(humroot.Position,mouse.Hit.Position).LookVector

to the server which changes the rotation by changing C0 values of motors

rightshoulder.C0 = CFrame.new(1,0.5,0)*CFrame.Angles(0,math.rad(90),math.sin(thecframe.Y))

hope this solved this problem
note that this shouldnt be used in first person, its just for serverside arm movement

2 Likes

i changed the solution to this. Thank you