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

Help with some welding problems?

Asked by
22ron 0
8 years ago

I have this script.

function HeadCFrame()
local dir = Mouse.UnitRay.Direction.unit
local hrot = Char.HumanoidRootPart.CFrame * CFrame.new(0, 1.5, 0)*CFrame.new(Char.Humanoid.CameraOffset)

Char.Torso.Neck.C0 = Char.Torso.CFrame:toObjectSpace(hrot)
local rot = -math.asin(dir.y)
Char.Torso.Neck.C1 = CFrame.Angles(rot, 0, 0)
end
function ArmCFrame()
local target,pos = game.Workspace:FindPartOnRay(Mouse.UnitRay, game.Workspace)
local opp = Mouse.Hit.p.Y-pos.Y
local hyp = (Mouse.Hit.p-pos).magnitude
RWeld.C0 = CFrame.new(1.5, 0, 0)*CFrame.Angles(math.pi/2,0,SOffSet/-30)
LWeld.C0 = CFrame.new(-1.5+SOffSet/-30, 0, SOffSet/20)*CFrame.Angles(math.pi/1.8,0,math.pi/8)

Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(Mouse.Hit.p.X,Torso.Position.Y,Mouse.Hit.p.Z))

It works in solo play but not in server mode. The arms are welded to the head. In server mode the arms and head face down. I don't know why this is happening :/

Answer this question