Guest User

Untitled

a guest
Mar 26th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.44 KB | None | 0 0
  1. local p = game.Players.LocalPlayer
  2. local RS = game:GetService("ReplicatedStorage")
  3. local runs = game:GetService("RunService")
  4. Moving = false
  5. xMove = 0
  6. yMove = 0
  7. xSprint = 0
  8. ySprint = 0
  9. sprinted = false
  10. sMoving = false
  11. DBounce = false
  12.  
  13. local list = {}
  14.  
  15. local player = game.Players.LocalPlayer
  16. local character = player.Character
  17. local arm1 = RS:WaitForChild("ArmRight"):clone()
  18. local arm2 = RS:WaitForChild("Arm"):clone()
  19. local arm3 = arm1:clone()
  20. arm3.Transparency = 1
  21. arm1.Parent = workspace
  22. arm2.Parent = workspace
  23. arm3.Parent = workspace
  24. --add gun
  25. local gun = RS:WaitForChild("GunPart"):clone()
  26. gun.Parent = workspace
  27. local index = #list+1
  28. local obj = ((player ~= p and character:WaitForChild("Torso")) or workspace.CurrentCamera)
  29. list[index] = {gun,obj,arm1,arm2,arm3,player}
  30. character:WaitForChild("Humanoid").Died:connect(function()
  31. list[index] = nil -- remove pls
  32. gun:Destroy()
  33. end)
  34.  
  35. game:GetService("RunService").RenderStepped:connect(function()
  36. for i,v in pairs(list) do --
  37. if sprinting then
  38. offset = ((v[2].Name=="Torso" and CFrame.new(2,0,-2)) or CFrame.new(1.5 + xMove,-1.215 + yMove,-3.0))*CFrame.Angles(math.rad(xSprint),math.rad(ySprint),math.rad(0))
  39. else
  40. offset = ((v[2].Name=="Torso" and CFrame.new(2,0,-2)) or CFrame.new(1.5 + xMove,-1.215 + yMove,-3.0))*CFrame.Angles(math.rad(0),math.rad(-5),math.rad(0))
  41. end
  42. v[1].CFrame = v[2].CFrame*offset--*CFrame.Angles(math.pi/2,0,0)
  43. _G.gun = v[1]
  44. --print(v[1].CFrame)
  45. if v[6] == p then
  46. --right arm
  47. v[3].CFrame = v[2].CFrame*offset
  48. *CFrame.new(1.4,-.3,1.4)*CFrame.Angles(math.rad(90),math.rad(20),math.rad(-40))
  49. --left arm
  50. v[4].CFrame = v[2].CFrame*offset
  51. *CFrame.new(-1.4,-1.2,0.05)*CFrame.Angles(math.rad(90),math.rad(20),math.rad(70))
  52. --left arm p2
  53. v[5].CFrame = v[2].CFrame*offset
  54. *CFrame.new(-4.8,-1.9,-1)*CFrame.Angles(math.rad(90),math.rad(30),math.rad(60))
  55. end
  56. end
  57. end)
  58.  
  59. game.Players.LocalPlayer.Character.Humanoid.Running:connect(function(speed)
  60. if speed > 0 then
  61. Moving = true
  62. else
  63. Moving = false
  64. end
  65. if speed > 16 then
  66. sprinting = true
  67. else
  68. sprinting = false
  69. end
  70. end)
  71.  
  72. wiggle = coroutine.create(function()
  73. while true do
  74. if Moving then
  75. if sprinting then
  76. for i = 1, 9 do
  77. xMove = xMove + 0.0045
  78. yMove = yMove + 0.0035
  79. runs.RenderStepped:wait()
  80. end
  81. if Moving then
  82. for i = 1, 8 do
  83. xMove = xMove - 0.0045
  84. yMove = yMove - 0.0035
  85. runs.RenderStepped:wait()
  86. end
  87. for i = 1, 8 do
  88. xMove = xMove - 0.0045
  89. yMove = yMove + 0.0035
  90. runs.RenderStepped:wait()
  91. end
  92. for i = 1, 8 do
  93. xMove = xMove + 0.0045
  94. yMove = yMove - 0.0035
  95. runs.RenderStepped:wait()
  96. end
  97. else
  98. for i = 1, 8 do
  99. xMove = xMove - 0.0045
  100. yMove = yMove - 0.0035
  101. runs.RenderStepped:wait()
  102. end
  103. end
  104. else
  105. for i = 1, 10 do
  106. xMove = xMove + 0.0045
  107. yMove = yMove + 0.0035
  108. runs.RenderStepped:wait()
  109. end
  110. if Moving then
  111. for i = 1, 10 do
  112. xMove = xMove - 0.0045
  113. yMove = yMove - 0.0035
  114. runs.RenderStepped:wait()
  115. end
  116. for i = 1, 10 do
  117. xMove = xMove - 0.0045
  118. yMove = yMove + 0.0035
  119. runs.RenderStepped:wait()
  120. end
  121. for i = 1, 10 do
  122. xMove = xMove + 0.0045
  123. yMove = yMove - 0.0035
  124. runs.RenderStepped:wait()
  125. end
  126. else
  127. for i = 1, 10 do
  128. xMove = xMove - 0.0045
  129. yMove = yMove - 0.0035
  130. runs.RenderStepped:wait()
  131. end
  132. end
  133. end
  134. end
  135. wait()
  136. end
  137. end)
  138.  
  139. coroutine.resume(wiggle)
  140.  
  141. local mouse = player:GetMouse()
  142. mouse.KeyDown:connect(function(key)
  143. if key == "0" then
  144. runningsprint = true
  145. local keyConnection = mouse.KeyUp:connect(function (key)
  146. if (key == "0") then
  147. runningsprint = false
  148. end
  149. end)
  150.  
  151. if sprinted == false and sMoving == false then
  152. sMoving = true
  153. for i = 1, 15 do
  154. xSprint = xSprint - 1/3
  155. ySprint = ySprint + 1
  156. runs.RenderStepped:wait()
  157. end
  158. xSprint = -5
  159. ySprint = 10
  160. sprinted = true
  161. sMoving = false
  162. end
  163.  
  164. repeat wait() until runningsprint == false
  165.  
  166. if sprinted == true and sMoving == false then
  167. sMoving = true
  168. for i = 1, 15 do
  169. xSprint = xSprint + 1/3
  170. ySprint = ySprint - 1
  171. runs.RenderStepped:wait()
  172. end
  173. xSprint = 0
  174. ySprint = -5
  175. sprinted = false
  176. sMoving = false
  177. end
  178. end
  179. end)
Advertisement
Add Comment
Please, Sign In to add comment