EDIT: I realized I was completely wrong. Use mouse.Hit.Z
mouse.Hit returns a CFrame value.
1 | local plr = game.Players.LocalPlayer |
2 | local m = plr:GetMouse() |
4 | m.Button 1 Down:connect( function (mouse) |
-> 0.0844552889, 0, -0.412481308, -0.999974728, 0.00373247126, -0.0060590161, -0, 0.851417065, 0.524489343, 0.00711639086, 0.524476111, -0.851395488
I think what you're looking for is mouse.Hit.p which returns the position of a part
1 | local plr = game.Players.LocalPlayer |
2 | local m = plr:GetMouse() |
4 | m.Button 1 Down:connect( function (mouse) |
-> 0,0,0
Use mouse.Hit.p.Z to get the Z value, so your new code would be:
1 | local plr = game.Players.LocalPlayer |
2 | local mouse = plr:GetMouse() |
4 | plr.Character.Torso.Neck.C 0 = CFrame.new( 0 , 1.5 , 0 )*CFrame.Angles( 0 , 0 ,mouse.Hit.p.Z) |