Advertisement
Theskyler900

armor test

Aug 19th, 2017
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. wait(1 / 60)
  2. Effects = { }
  3. local Player = game.Players.localPlayer
  4. local Character = Player.Character
  5. local Humanoid = Character.Humanoid
  6. local Mouse = Player:GetMouse()
  7. local LeftArm = Character["Left Arm"]
  8. local RightArm = Character["Right Arm"]
  9. local LeftLeg = Character["Left Leg"]
  10. local RightLeg = Character["Right Leg"]
  11. local Head = Character.Head
  12. local Torso = Character.Torso
  13. local Camera = game.Workspace.CurrentCamera
  14. local RootPart = Character.HumanoidRootPart
  15. local RootJoint = RootPart.RootJoint
  16. local attack = false
  17. local Anim = 'Idle'
  18. local attacktype = 1
  19. local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  20. local velocity = RootPart.Velocity.y
  21. local sine = 0
  22. local change = 1
  23. local Create = LoadLibrary("RbxUtility").Create
  24.  
  25. local m = Create("Model"){
  26. Parent = Character,
  27. Name = "WeaponModel",
  28. }
  29.  
  30. Humanoid.Animator.Parent = nil
  31. Character.Animate.Parent = nil
  32.  
  33. local newMotor = function(part0, part1, c0, c1)
  34. local w = Create('Motor'){
  35. Parent = part0,
  36. Part0 = part0,
  37. Part1 = part1,
  38. C0 = c0,
  39. C1 = c1,
  40. }
  41. return w
  42. end
  43.  
  44. function clerp(a, b, t)
  45. return a:lerp(b, t)
  46. end
  47.  
  48. RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  49. NeckCF = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  50.  
  51. local RW = newMotor(Torso, RightArm, CFrame.new(1.5, 0, 0), CFrame.new(0, 0, 0))
  52. local LW = newMotor(Torso, LeftArm, CFrame.new(-1.5, 0, 0), CFrame.new(0, 0, 0))
  53. local RH = newMotor(Torso, RightLeg, CFrame.new(.5, -2, 0), CFrame.new(0, 0, 0))
  54. local LH = newMotor(Torso, LeftLeg, CFrame.new(-.5, -2, 0), CFrame.new(0, 0, 0))
  55. RootJoint.C1 = CFrame.new(0, 0, 0)
  56. RootJoint.C0 = CFrame.new(0, 0, 0)
  57. Torso.Neck.C1 = CFrame.new(0, 0, 0)
  58. Torso.Neck.C0 = CFrame.new(0, 1.5, 0)
  59.  
  60. local rarmc1 = RW.C1
  61. local larmc1 = LW.C1
  62. local rlegc1 = RH.C1
  63. local llegc1 = LH.C1
  64.  
  65. local resetc1 = false
  66.  
  67. function PlayAnimationFromTable(table, speed, bool)
  68. RootJoint.C0 = clerp(RootJoint.C0, table[1], speed)
  69. Torso.Neck.C0 = clerp(Torso.Neck.C0, table[2], speed)
  70. RW.C0 = clerp(RW.C0, table[3], speed)
  71. LW.C0 = clerp(LW.C0, table[4], speed)
  72. RH.C0 = clerp(RH.C0, table[5], speed)
  73. LH.C0 = clerp(LH.C0, table[6], speed)
  74. if bool == true then
  75. if resetc1 == false then
  76. resetc1 = true
  77. RootJoint.C1 = RootJoint.C1
  78. Torso.Neck.C1 = Torso.Neck.C1
  79. RW.C1 = rarmc1
  80. LW.C1 = larmc1
  81. RH.C1 = rlegc1
  82. LH.C1 = llegc1
  83. end
  84. end
  85. end
  86.  
  87. ArtificialHB = Create("BindableEvent", script){
  88. Parent = script,
  89. Name = "Heartbeat",
  90. }
  91.  
  92. script:WaitForChild("Heartbeat")
  93.  
  94. frame = 1 / 30
  95. tf = 0
  96. allowframeloss = false
  97. tossremainder = false
  98. lastframe = tick()
  99. script.Heartbeat:Fire()
  100.  
  101. game:GetService("RunService").Heartbeat:connect(function(s, p)
  102. tf = tf + s
  103. if tf >= frame then
  104. if allowframeloss then
  105. script.Heartbeat:Fire()
  106. lastframe = tick()
  107. else
  108. for i = 1, math.floor(tf / frame) do
  109. script.Heartbeat:Fire()
  110. end
  111. lastframe = tick()
  112. end
  113. if tossremainder then
  114. tf = 0
  115. else
  116. tf = tf - frame * math.floor(tf / frame)
  117. end
  118. end
  119. end)
  120.  
  121. function swait(num)
  122. if num == 0 or num == nil then
  123. ArtificialHB.Event:wait()
  124. else
  125. for i = 0, num do
  126. ArtificialHB.Event:wait()
  127. end
  128. end
  129. end
  130.  
  131. function RemoveOutlines(part)
  132. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  133. end
  134.  
  135. CFuncs = {
  136. Part = {
  137. Create = function(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
  138. local Part = Create("Part"){
  139. Parent = Parent,
  140. Reflectance = Reflectance,
  141. Transparency = Transparency,
  142. CanCollide = false,
  143. Locked = true,
  144. BrickColor = BrickColor.new(tostring(BColor)),
  145. Name = Name,
  146. Size = Size,
  147. Material = Material,
  148. }
  149. RemoveOutlines(Part)
  150. return Part
  151. end;
  152. };
  153.  
  154. Mesh = {
  155. Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  156. local Msh = Create(Mesh){
  157. Parent = Part,
  158. Offset = OffSet,
  159. Scale = Scale,
  160. }
  161. if Mesh == "SpecialMesh" then
  162. Msh.MeshType = MeshType
  163. Msh.MeshId = MeshId
  164. end
  165. return Msh
  166. end;
  167. };
  168.  
  169. Weld = {
  170. Create = function(Parent, Part0, Part1, C0, C1)
  171. local Weld = Create("Weld"){
  172. Parent = Parent,
  173. Part0 = Part0,
  174. Part1 = Part1,
  175. C0 = C0,
  176. C1 = C1,
  177. }
  178. return Weld
  179. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement