After i fanally got the viewmodel working a another problem.
I want to move the arms to the mouse and when it’s active this happens:
But when it’s not activated everything is fine:
The client code:
Events.MoveArms:FireServer(CFrame.new(1,0.5,0) * CFrame.Angles(-math.asin((Mouse.Origin.p - Mouse.Hit.p).unit.y),1.55,0), CFrame.new(-1,0.5,0) * CFrame.Angles(-math.asin((Mouse.Origin.p - Mouse.Hit.p).unit.y),-1.55,0))
The server code:
Events.MoveArms.OnServerEvent:Connect(function(Player, RC0, LC0)
local Character = Player.Character
if Character and Character.Torso then
Character.Torso["Right Shoulder"].C0 = RC0
Character.Torso.ToolGrip.C0 = Character.Torso["Right Shoulder"].C0 * CFrame.fromEulerAnglesXYZ(0, math.pi/-2,0) * CFrame.new(-1,-0.5,0)
Character.Torso["Left Shoulder"].C0 = LC0
end
end)
Thanks!