Advertisement
tyridge77

Untitled

Sep 4th, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1.     local x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22 = currentcframe:components();
  2.         local torsocf = CFrame.new(x,ypos,z,R00,R01,R02,R10,R11,R12,R20,R21,R22);
  3.         local cf = torsocf;
  4.         local cfp = cf.p;
  5.         if turntorsoto and turntorsoto~=last_turn then
  6.             -- Changed turn
  7.             v.turnlv = cf*CFrame.new(0,0,-3).p;
  8.             v.turnlerp = 0;
  9.         end
  10.    
  11.         if status == "walking" then
  12.          cf = CFrame.new(currentcframe.p+currentcframe.lookVector*((.1)*Speed*updateTime))
  13.         end
  14.         if turntorsoto ~= nil and turnlerp and turnlv then
  15.          local clamped = Vector3.new(turntorsoto.X,currentcframe.p.Y,turntorsoto.Z)
  16.           cf = CFrame.new(
  17.             cf.p,
  18.             v.turnlv:lerp(clamped,clamp(v.turnlerp,0,1))
  19.          );
  20.         end
  21.         cfp = cf.p;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement