generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Arms follow mouse ( coordinateFrame.p )

Previous Thread :: Next Thread 
Shonysky is not online. Shonysky
Joined: 05 Aug 2013
Total Posts: 361
29 Nov 2013 06:54 PM
can someone just help me at a script like this, when mousemoved its connect with a function to set the arms CFrame to the coordinateFrame?
please, im really trying to do, and i can't.
Report Abuse
Shonysky is not online. Shonysky
Joined: 05 Aug 2013
Total Posts: 361
29 Nov 2013 07:27 PM
i thought someone will reply it...
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
29 Nov 2013 07:34 PM
Basically...

local mouse = game.Players.LocalPlayer:GetMouse()
local current = mouse.X + mouse.Y
local player = game.Players.LocalPlayer
mouse.Moved:connect(function()
ec = mouse.X + mouse.Y
if ec < current and player.Character then
player.Character["Right Arm"].CFrame = player.Character["Right Arm"].CFrame * CFrame.Angles() -- figure out the Angles you want, use math.rad
elseif ec > current and player.Character then
player.Character["Right Arm"].CFrame = player.Character["Right Arm"].CFrame * CFrame.Angles() -- figure out the Angles you want, use math.rad
end
end)
Report Abuse
Shonysky is not online. Shonysky
Joined: 05 Aug 2013
Total Posts: 361
29 Nov 2013 08:05 PM
i put this in a tool?
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
29 Nov 2013 08:08 PM
LocalScript. Then put the LocalScript into the StarterGui
Report Abuse
Shonysky is not online. Shonysky
Joined: 05 Aug 2013
Total Posts: 361
29 Nov 2013 08:14 PM
Error: Moved is not a valid member
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
29 Nov 2013 08:54 PM
local mouse = game.Players.LocalPlayer:GetMouse()
local current = mouse.Y
local player = game.Players.LocalPlayer
local down = 0
mouse.Move:connect(function()
ec = mouse.Y
if ec < current and player.Character then
player.Character.Torso["Right Shoulder"].C1 = player.Character.Torso["Right Shoulder"].C1 *
CFrame.Angles(math.rad(0), math.rad(0), math.rad(mouse.Y/50))
player.Character.Torso["Left Shoulder"].C1 = player.Character.Torso["Left Shoulder"].C1 *
CFrame.Angles(math.rad(0), math.rad(0), math.rad(mouse.Y/50))
current = ec
elseif ec > current and player.Character then
player.Character.Torso["Right Shoulder"].C1 = player.Character.Torso["Right Shoulder"].C1 *
CFrame.Angles(math.rad(0), math.rad(0), math.rad(-mouse.Y/90))
player.Character.Torso["Left Shoulder"].C1 = player.Character.Torso["Left Shoulder"].C1 *
CFrame.Angles(math.rad(0), math.rad(0),math.rad(-mouse.Y/90))
current = ec
end
end)
Report Abuse
Shonysky is not online. Shonysky
Joined: 05 Aug 2013
Total Posts: 361
30 Nov 2013 06:57 AM
thats working, but doesn't work in first person
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image