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

Can anyone explain how to fix this math error for arm rotation?

Asked by 10 years ago
repeat wait(0.1) until (game.Players.LocalPlayer ~= nil) and (game.Players.LocalPlayer.Character ~= nil)
Player = game.Players.LocalPlayer
Char = Player.Character

Mouse = Player:GetMouse()

Cam = Workspace.CurrentCamera

FakeA = Char["Left Arm"]:Clone()
FakeA.Parent = Char
FakeA.Name = "FakeA"

Weld = Instance.new("Weld", Char)
Weld.Name = "ArmWeld"
Weld.Part0 = Char["Left Arm"]
Weld.Part1 = FakeA
Weld.C1 = Weld.C0



while true do
    wait()

    if Weld ~= nil and FakeA ~= nil then
        Weld.C1 = CFrame.new(0,1,0)* CFrame.Angles(math.atan2(Mouse.X*math.pi,Mouse.Y*math.pi),math.rad(180),0)
    end
end

Answer this question