So I made this script where it follows your mouse up and down.
There’s just 1 problem and it’s that the tool welded to the torso has an offset.
Footage:
Code:
local RunService = game:GetService("RunService");
local player = game:GetService("Players").LocalPlayer;
local char = script.Parent;
local cam = workspace.CurrentCamera;
local mouse = player:GetMouse();
local head = char:WaitForChild("Head");
local hum = char:WaitForChild("Humanoid");
local RA = char:WaitForChild("Right Arm");
local LA = char:WaitForChild("Left Arm");
local torso = char:WaitForChild("Torso");
local RS = torso:WaitForChild("Right Shoulder");
local LS = torso:WaitForChild("Left Shoulder");
local RSDC0 = RS.C0;
local LSDC0 = LS.C0;
local replicate = game.ReplicatedStorage.Remotes.UpdateClient;
local delta = 0;
while hum.Health > 0 do
local tool = char:FindFirstChildOfClass("Tool");
if tool then
local x, y, z = RSDC0:ToEulerAnglesYXZ();
local x1, y1, z1 = LSDC0:ToEulerAnglesYXZ();
local r = (RSDC0 * CFrame.Angles(0, 0, -z)) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y));
local l = (LSDC0 * CFrame.Angles(0, 0, -z1)) * CFrame.Angles(0, 0, math.asin((-mouse.Hit.p + mouse.Origin.p).unit.y));
RS.C0 = RS.C0:Lerp(r, .25);
LS.C0 = LS.C0:Lerp(l, .25);
local m6d = tool:FindFirstChildOfClass("Script"):FindFirstChildOfClass("Motor6D");
if m6d then
local xx, yy, zz = m6d.Value.Value:ToEulerAnglesYXZ();
local s = m6d.Value.Value * CFrame.Angles(0,0,zz) * CFrame.Angles(0,0,math.asin((-mouse.Hit.p + mouse.Origin.p).unit.y));
m6d.C0 = m6d.C0:Lerp(s, .25);
end;
if delta >= .1 then
replicate:FireServer(
{{RS.C0:GetComponents()}},
{{LS.C0:GetComponents()}},
m6d and {m6d, {m6d.C0:GetComponents()}}
);
delta = 0;
end;
else
if delta >= .1 and RS.C0 ~= RSDC0 and LS.C0 ~= LSDC0 then
RS.C0 = RSDC0;
LS.C0 = LSDC0;
replicate:FireServer(
{{RSDC0:GetComponents()}},
{{LSDC0:GetComponents()}}
);
end;
if delta > 500 then delta = 0; end;
end;
delta = delta + RunService.RenderStepped:Wait();
end;
Any help appreciated