Advertisement
LuaWeaver

Fixed for Orca

Feb 18th, 2014
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.91 KB | None | 0 0
  1. TweenAngle = function(Weld, DestinationCF, Time)
  2.         if (TweenExclusions[Weld] ~= true or Ignore) then
  3.                 local Key = Weld;
  4.                 Tween_Data[Key] = (Tween_Data[Key] == nil) and 1 or Tween_Data[Key] + 1;
  5.                 local Current_Iteration = Tween_Data[Key];
  6.                
  7.                 Spawn(function()
  8.                         local OldAngle = Vector3.new(Weld.C1:toEulerAnglesXYZ())
  9.                         local NewAngle = Vector3.new(DestinationCF:toEulerAnglesXYZ())
  10.                         local PercentageComplete = 0
  11.                         local TimeStarted = tick()
  12.                        
  13.                         while PercentageComplete <= 1 do
  14.                                 PercentageComplete = math.min((tick()-TimeStarted)/Time, 1)
  15.                                 if (Tween_Data[Key] == Current_Iteration) and (TweenExclusions[Weld] ~= true) then
  16.                                         Weld.C1 = CFrame.Angles(
  17.                                                 (OldAngle.x*(1-PercentageComplete))+(NewAngle.x*PercentageComplete),
  18.                                                 (OldAngle.y*(1-PercentageComplete))+(NewAngle.y*PercentageComplete),
  19.                                                 (OldAngle.z*(1-PercentageComplete))+(NewAngle.z*PercentageComplete)
  20.                                         )
  21.                                        
  22.                                         SteppedWait()
  23.                                 else
  24.                                         break
  25.                                 end
  26.                         end
  27.                        
  28.                         if (Tween_Data[Key] == Current_Iteration) and (TweenExclusions[Weld] ~= true) then
  29.                                 Weld.C1 = DestinationCF
  30.                         end
  31.                    
  32.             if PercentageComplete==1 then
  33.                 break
  34.             end
  35.                 end)
  36.         end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement