Advertisement
Aeyao

ESIFODUIA9UHGU9ERSU89VT90854W09T2YN05V2NY0TY97052Y0T25VNWHOI

Jul 10th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.45 KB | None | 0 0
  1. local p = game.Players.LocalPlayer
  2. local c = p.Character
  3. local m = p:GetMouse()
  4.  
  5. c.Animate:Destroy()
  6.  
  7. for i,v in next,c.Humanoid:GetPlayingAnimationTracks() do
  8. v:Stop()
  9. end
  10.  
  11. local rightarm = c["Right Arm"]
  12. local leftarm = c["Left Arm"]
  13. local rad = math.pi/180
  14.  
  15. local origins = {
  16. RA = CFrame.new(-.3,0,-.8)*CFrame.Angles(0,0,math.pi*.5),
  17. LA = CFrame.new(-1,-.2,-1.3)*CFrame.Angles(0,-40*rad,-100*rad),
  18.  
  19. RL = CFrame.new(0,0,0),
  20. LL = CFrame.new(0,0,0),
  21.  
  22. Root = CFrame.new()*CFrame.Angles(0,0,-50*rad),
  23. Neck = CFrame.Angles(0,0,50*rad),
  24. }
  25.  
  26. local animations = {
  27. reload = {
  28. {
  29. RA = CFrame.new(-.3,0,-.8)*CFrame.Angles(0,10*rad,math.pi*.6),
  30. LA = CFrame.new(-1,-.2,-1.3)*CFrame.Angles(0,-40*rad,-100*rad),
  31.  
  32.  
  33. RL = CFrame.new(0,0,0),
  34. LL = CFrame.new(0,0,0),
  35.  
  36. Root = CFrame.new()*CFrame.Angles(0,0,-10*rad),
  37. Neck = CFrame.Angles(0,0,10*rad),
  38.  
  39. frametime = .5,
  40. },
  41.  
  42. {
  43. RA = CFrame.new(-.3,0,-.8)*CFrame.Angles(0,10*rad,math.pi*.6),
  44. LA = CFrame.new(-1,-.2,-1.3)*CFrame.Angles(0,-40*rad,-70*rad),
  45.  
  46. RL = CFrame.new(0,0,0),
  47. LL = CFrame.new(0,0,0),
  48.  
  49. Root = CFrame.new()*CFrame.Angles(0,0,-10*rad),
  50. Neck = CFrame.Angles(0,0,10*rad),
  51.  
  52. frametime = .5,
  53. },
  54.  
  55. }
  56. }
  57.  
  58. local attachments = {
  59. RA = c.Torso["Right Shoulder"],
  60. RL = c.Torso["Right Hip"],
  61.  
  62. LA = c.Torso["Left Shoulder"],
  63. LL = c.Torso["Left Hip"],
  64.  
  65. Root = c.HumanoidRootPart.RootJoint,
  66. Neck = c.Torso.Neck,
  67. }
  68.  
  69. local poses = {
  70. RA = CFrame.new(0,0,0),
  71. LA = CFrame.new(0,0,0),
  72.  
  73. RL = CFrame.new(0,0,0),
  74. LL = CFrame.new(0,0,0),
  75.  
  76. Root = CFrame.new(),
  77.  
  78. }
  79.  
  80. local recoil = CFrame.new()
  81. local recoil2 = CFrame.new()
  82.  
  83. local ins = Instance.new
  84. local gunpart = ins("Part")
  85. gunpart.CanCollide = false
  86.  
  87. local gunweld = ins("Weld",gunpart)
  88. gunweld.Part0 = gunpart
  89. gunweld.Part1 = rightarm
  90. gunweld.C0 = CFrame.Angles(-math.pi*.5,math.pi,0) * CFrame.new(0,1,.3)
  91. local gunc0 = CFrame.Angles(-math.pi*.5,math.pi,0) * CFrame.new(0,1,.3)
  92.  
  93. local gunmesh = ins("SpecialMesh",gunpart)
  94. gunmesh.MeshId = "rbxassetid://449919548"
  95. gunmesh.TextureId = "rbxassetid://449919568"
  96. gunmesh.Offset = Vector3.new(0, 0.2, 0.7)
  97. gunmesh.Scale = Vector3.new(0.015, 0.015, 0.015)
  98.  
  99. local sound = ins("Sound",gunpart)
  100. sound.SoundId = "rbxassetid://2016246584"
  101.  
  102. gunpart.Parent = workspace
  103.  
  104. local rs = game:GetService("RunService").RenderStepped
  105.  
  106. local currentanim = nil
  107.  
  108. local function playanimation(animation)
  109.  
  110. local framenum = #animation
  111. local currentframe = 1
  112. local framewait = 0
  113.  
  114. local self = {}
  115. self.stop = false
  116.  
  117. function self:start()
  118. repeat
  119. framewait = tick() + animation[currentframe].frametime
  120. for i,v in next,animation[currentframe] do
  121. if i ~= "frametime" then
  122. poses[i] = v
  123. end
  124. end
  125. repeat wait() until framewait < tick() or self.stop == true
  126. currentframe = currentframe + 1
  127. until currentframe > framenum or self.stop == true
  128. currentanim = nil
  129. self = nil
  130. end
  131.  
  132. return self
  133. end
  134. local ammo = 10
  135. local waitshoot = 0
  136. local rpm = 100
  137. local shootdown = false
  138. local aiming = false
  139.  
  140. function bloom(pos,size,col,r,m,c)
  141. spawn(function()
  142. local bloomp = ins("Part")
  143. bloomp.Shape = "Ball"
  144. bloomp.Anchored = true
  145. bloomp.CanCollide = false
  146. bloomp.Material = m or "Neon"
  147. bloomp.Color = col
  148. bloomp.CFrame = CFrame.new(pos)
  149. bloomp.Size = Vector3.new()
  150. bloomp.Parent = gunpart
  151. game.Debris:AddItem(bloomp,3)
  152.  
  153. local a = .05
  154. if r then
  155. a = r
  156. end
  157. local change = CFrame.new()
  158. if c then
  159. change = c
  160. end
  161.  
  162. repeat
  163. local oldp = bloomp.CFrame
  164. bloomp.Transparency = bloomp.Transparency + a
  165. bloomp.Size = bloomp.Size:lerp(Vector3.new(size,size,size),.3)
  166. bloomp.CFrame = oldp * change
  167. rs:wait()
  168. until bloomp.Transparency == 1
  169.  
  170. game.Debris:AddItem(bloomp,0)
  171. end)
  172. end
  173. local posting = CFrame.new(-0.05,0.05,4.3)
  174. function shoot()
  175. if shootdown == true then
  176. if waitshoot > tick() then return end
  177. waitshoot = tick() + (60/rpm)
  178.  
  179. for i = 1,math.random(3,4) do
  180. bloom((gunpart.CFrame*posting*CFrame.new(math.random(-10,10)/80,.5+math.random(-10,10)/80,-1)).p,math.random(10,15)/20,Color3.fromRGB(255, math.random(10,190), 0),.3)
  181. end
  182.  
  183. local ray = Ray.new((gunpart.CFrame*posting).p,gunpart.CFrame.lookVector*-999)
  184. local h,pos,r = workspace:FindPartOnRayWithIgnoreList(ray,{c,gunpart})
  185. local dist = ((gunpart.CFrame*posting).p-pos).magnitude
  186. local raything = ins("Part")
  187. local olde = (gunpart.CFrame*posting)
  188. raything.Transparency = 1
  189. raything.Size = Vector3.new(.1,.1,10)
  190. raything.Anchored = true
  191. raything.CanCollide = false
  192. raything.Material = "Neon"
  193. raything.Parent = gunpart
  194. raything.CFrame = olde
  195.  
  196. spawn(function()
  197. game.Debris:AddItem(raything,2)
  198. for i = 0,3 do
  199. if raything.CFrame.p == pos then
  200. raything:Destroy()
  201. else
  202. raything.CFrame = raything.CFrame:lerp(CFrame.new(pos)*(olde-olde.p),((i/3)/dist)*100)
  203. raything.Transparency = raything.Transparency - .3
  204. rs:wait()
  205. end
  206. end
  207. raything:Destroy()
  208. end)
  209.  
  210. sound:Play()
  211.  
  212. recoil = recoil * CFrame.new(-.2,0,0) * CFrame.Angles(0,0,2*rad)
  213. recoil2 = recoil2 * CFrame.new(.2,0,0) * CFrame.Angles(0,0,-2*rad)
  214.  
  215. if h then
  216.  
  217. if h.Parent:IsA("Accessory") then
  218. h.Parent:Destroy()
  219. end
  220.  
  221. if h.Parent:FindFirstChildOfClass("Humanoid") then
  222. h.Parent:FindFirstChildOfClass("Humanoid").Health = h.Parent:FindFirstChildOfClass("Humanoid").Health - (110/(math.random(10,12)/10))
  223. if h.Name == "Head" then
  224. h:Destroy()
  225. end
  226. end
  227.  
  228. end
  229.  
  230. end
  231. end
  232.  
  233. local ff = Instance.new("ForceField",c)
  234. ff.Visible = false
  235.  
  236. m.Button1Down:connect(function()
  237. shootdown = true
  238. end)
  239. m.Button1Up:connect(function()
  240. shootdown = false
  241. end)
  242.  
  243. local aimbottarg = nil
  244. m.Button2Down:connect(function()
  245. aiming = true
  246. if m.Target then
  247. aimbottarg = m.Target
  248. end
  249. end)
  250.  
  251. m.Button2Up:connect(function()
  252. aiming = false
  253. end)
  254.  
  255. local running = false
  256.  
  257. m.KeyDown:connect(function(k)
  258. if k == "r" then
  259. if currentanim then
  260. currentanim.stop = true
  261. end
  262.  
  263. currentanim = playanimation(animations.reload)
  264. currentanim:start()
  265. end
  266.  
  267. if k == "0" then
  268. running = true
  269. end
  270. end)
  271.  
  272. m.KeyUp:connect(function(k)
  273. if k == "0" then
  274. running = false
  275. end
  276. end)
  277.  
  278. print(attachments.LA.C0)
  279.  
  280. local rleg = attachments.RL.C0
  281. local lleg = attachments.LL.C0
  282. local neck = attachments.Neck.C0
  283. local hrp = attachments.Root.C0
  284. local head = c.Head
  285. local walktick = 0
  286. local look = CFrame.new()
  287.  
  288. m.TargetFilter = gunpart
  289. local cam = workspace.CurrentCamera
  290.  
  291. game:GetService("RunService"):BindToRenderStep("hey2",999999999999,function(dt)
  292. c.Humanoid.MaxHealth = math.huge
  293. c.Humanoid.Health = math.huge
  294. end)
  295.  
  296.  
  297.  
  298. game:GetService("RunService"):BindToRenderStep("hey",0,function(dt)
  299.  
  300. leftarm.LocalTransparencyModifier = 0
  301. rightarm.LocalTransparencyModifier = 0
  302.  
  303. shoot()
  304. local tock = tick()
  305.  
  306. if currentanim == nil then
  307. for i,v in next,poses do
  308. poses[i] = origins[i]
  309. end
  310. end
  311.  
  312. if running then
  313. c.Humanoid.WalkSpeed = 40
  314. c.Humanoid.JumpPower = 120
  315. else
  316. c.Humanoid.WalkSpeed = 23
  317. c.Humanoid.JumpPower = 60
  318. end
  319.  
  320. walktick = walktick + (c.HumanoidRootPart.Velocity.magnitude/80)
  321.  
  322. look = CFrame.new(head.CFrame.p,m.Hit.p)
  323. --look = look-look.p
  324. local ctos = c.Torso.CFrame:toObjectSpace(look)
  325. local cx,cy,cz = ctos:toEulerAnglesXYZ()
  326. local cx2,cy2,cz2 = look:toEulerAnglesXYZ()
  327.  
  328. attachments.RL.C0 = rleg * CFrame.Angles(0,0,math.sin(-walktick)*.4)*CFrame.new(0,math.max(math.cos(walktick+math.pi)*.4,0),0)
  329. attachments.LL.C0 = lleg * CFrame.Angles(0,0,math.sin(-walktick)*.4)*CFrame.new(0,math.max(math.cos(walktick)*.4,0),0)
  330.  
  331. if aiming then
  332. cam.FieldOfView = 30
  333. if aimbottarg then
  334. cam.CFrame = CFrame.new(cam.CFrame.p,aimbottarg.CFrame.p)
  335. end
  336. else
  337. cam.FieldOfView = 80
  338. end
  339.  
  340. for i,v in next,attachments do
  341.  
  342.  
  343. if i == "RA" then
  344. if aiming == false then
  345. v.Part0 = c.Head
  346. v.C0 = v.C0:lerp(CFrame.new(1,-1,0, 0, 0, 1, 0, 1, 0, -1, -0, -0) * recoil,math.min(dt*20,1))
  347. else
  348. v.Part0 = c.Head
  349. v.C0 = v.C0:lerp(CFrame.new(1,-1,0, 0, 0, 1, 0, 1, 0, -1, -0, -0) * recoil*CFrame.Angles(-10*rad,0,0),math.min(dt*20,1))
  350. end
  351. elseif i == "LA" then
  352. if aiming == false then
  353. v.Part0 = c.Head
  354. v.C0 = v.C0:lerp(CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) * recoil2,math.min(dt*20,1))
  355. else
  356. v.Part0 = c.Head
  357. v.C0 = v.C0:lerp(CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) * recoil2*CFrame.Angles(-3*rad,0,0),math.min(dt*20,1))
  358. end
  359. elseif i == "Neck" then
  360. if aiming == false then
  361. v.C0 = v.C0:lerp(CFrame.new(0,1.5,0)*(ctos-ctos.p),math.min(dt*10,1))
  362. else
  363. v.C0 = CFrame.new(0,1.5,0)*(ctos-ctos.p)*CFrame.Angles(0,0,-10*rad)
  364. end
  365. v.C1 = CFrame.new()
  366.  
  367. elseif i == "Root" then
  368. --v.C0 = v.C0:lerp(hrp*CFrame.Angles(0,0,cy),math.min(dt*10,1))
  369. end
  370.  
  371. if i == "Neck" then
  372. --v.Transform = v.Transform:lerp(CFrame.new(poses[i].p),math.min(dt,1)*10)
  373. else
  374. v.Transform = v.Transform:lerp(poses[i],math.min(dt*10,1))
  375. end
  376.  
  377. end
  378.  
  379. recoil = recoil:lerp(CFrame.new(),math.min(dt*10,1))
  380. recoil2 = recoil2:lerp(CFrame.new(),math.min(dt*10,1))
  381. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement