I've been trying to get the mouse and head to both look at the mouse, the head works but I've tried a lot of things to get the arms to move. The arm is backwards and such. This script also kills you once when you test it I have no clue why that is happening. This is a localscript in starterpack. Please help and explain what is wrong!
repeat wait() until game.Players.LocalPlayer
local Player = game.Players.LocalPlayer
repeat wait() until Player.Character
local Character = Player.Character
repeat wait() until Character:FindFirstChild("Torso")
local Mouse = Player:GetMouse()
local Camera = game.Workspace.CurrentCamera
local Torso = Character:FindFirstChild("Torso")
for i, v in pairs(Character:GetChildren()) do
if v:IsA("BasePart") and v.Name == "Left Arm" or v.Name == "Right Arm" then
local arm = v:Clone()
arm.Parent = Camera
local weld = Instance.new("Motor6D", arm)
weld.Part0 = arm
weld.Part1 = v
end
end
game:GetService("RunService").RenderStepped:connect(function()
Mouse.TargetFilter = game.Workspace
Torso.Neck.C1 = CFrame.new(0, 0, 0)
Torso.Neck.C0 = CFrame.new(0, 1.5, 0) * CFrame.Angles(math.asin((Mouse.Hit.p - Mouse.Origin.p).unit.y), 0, 0)
Torso["Left Shoulder"].C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) * CFrame.Angles(0, 0, (Mouse.Hit.p - Mouse.Origin.p).unit.y * math.tan(90))
end)

1 comment
The only thing that needs modification is line 25**