Advertisement
HoneyBadger69

Untitled

Jun 17th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.23 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("Made by DarkPengeHUN")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local Mouse = Player:GetMouse()
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87.  
  88. -- Created by 129K
  89. local animations = {
  90. requip = {
  91. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(90), 0, math.rad(-10)) * CFrame.new(1.5, -.5, 0);
  92. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(180), 0, math.rad(-15)) * CFrame.new(1.5, -.5, 0);
  93. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(210), 0, math.rad(-40)) * CFrame.new(1.5, -.5, 0);
  94. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(180), 0, math.rad(-10)) * CFrame.new(1.5, -.5, 0);
  95. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(1.5, -.5, 0);
  96. };
  97. lequip = {
  98. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(90), 0, math.rad(60)) * CFrame.new(-1, -.75, 0);
  99. };
  100. runequip = {
  101. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(90), 0, math.rad(-10)) * CFrame.new(1.5, -.5, 0);
  102. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(180), 0, math.rad(-15)) * CFrame.new(1.5, -.5, 0);
  103. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(210), 0, math.rad(-40)) * CFrame.new(1.5, -.5, 0);
  104. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(180), 0, math.rad(-10)) * CFrame.new(1.5, -.5, 0);
  105. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(1.5, -.5, 0);
  106. CFrame.new(1.5, 0, 0);
  107. };
  108. rshoot = {
  109. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(170), 0, 0) * CFrame.new(1.5, -.5, 0);
  110. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(1.5, -.5, 0);
  111. };
  112. lshoot = {
  113. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(170), 0, math.rad(60)) * CFrame.new(-1, -.75, 0);
  114. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(90), 0, math.rad(60)) * CFrame.new(-1, -.75, 0);
  115. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(90), 0, math.rad(80)) * CFrame.new(-.5, -.35, 0);
  116. CFrame.new(0, .5, 0) * CFrame.Angles(math.rad(90), 0, math.rad(60)) * CFrame.new(-1, -.75, 0);
  117. };
  118. }
  119. local player = owner
  120. local char = player.Character
  121. local bin = Instance.new("HopperBin", player.Backpack)
  122. local pmouse = Player:GetMouse()
  123. local barrelsize = .3
  124. local handleweld = nil
  125. local temp = true
  126. local etemp = true
  127. bin.Name = "L96A1 Magnum"
  128. function weld(part0, part1, c0, c1, parent)
  129. local w = Instance.new("Weld", parent)
  130. w.Part0 = part0
  131. w.Part1 = part1
  132. w.C0 = c0
  133. w.C1 = c1
  134. w.Name = "NewWeld"
  135. return w
  136. end
  137. function interpolateCFrame(cf1, cf2)
  138. local t1 = {cf1:components()}
  139. local t2 = {cf2:components()}
  140. local newcf = {}
  141. for i, v in pairs(t1) do
  142. local dif = t2[i] - v
  143. if i < 4 then
  144. local newValue = nil
  145. if math.abs(dif) < .1 then
  146. newValue = t2[i]
  147. else
  148. newValue = v + ((dif/math.abs(dif)) * .1)
  149. end
  150. newcf[i] = newValue
  151. else
  152. local newValue = nil
  153. if math.abs(dif) < .1 then
  154. newValue = t2[i]
  155. else
  156. newValue = v + ((dif/math.abs(dif)) * .1)
  157. end
  158. newcf[i] = newValue
  159. end
  160. end
  161. return CFrame.new(unpack(newcf))
  162. end
  163. function prop(name, sx, sy, sz, px, py, pz, anc, canc, col, par, mesh, meshtype, scalex, scaley, scalez, meshid, textureid)
  164. local part = Instance.new("Part", par)
  165. part.Name = name
  166. part.TopSurface = 0
  167. part.BottomSurface = 0
  168. part.formFactor = 3
  169. part.Size = Vector3.new(sx, sy, sz)
  170. part.Position = Vector3.new(px, py, pz)
  171. part.Anchored = anc
  172. part.CanCollide = canc
  173. part.BrickColor = BrickColor.new(col)
  174. if mesh then
  175. local m = Instance.new("SpecialMesh", part)
  176. m.MeshType = meshtype
  177. m.MeshId = meshid
  178. m.Scale = Vector3.new(scalex, scaley, scalez)
  179. m.TextureId = textureid
  180. end
  181. return part
  182. end
  183. function fade(part, speed)
  184. for i = part.Transparency, 1, speed do
  185. part.Transparency = i
  186. wait()
  187. end
  188. part:Destroy()
  189. end
  190. function clearWelds(par)
  191. for i, v in pairs(par:GetChildren()) do
  192. if v.Name == "NewWeld" and v:IsA("Weld") then
  193. v:Destroy()
  194. end
  195. end
  196. end
  197. function sound(pitch, id, par)
  198. local s = Instance.new("Sound", par)
  199. s.Pitch = pitch
  200. s.SoundId = id
  201. return s
  202. end
  203. function traceRay(pos, pos2, col, trans)
  204. local distance = (pos - pos2).magnitude
  205. local trace = Instance.new("Part", char)
  206. trace.Anchored = true
  207. trace.CanCollide = false
  208. trace.TopSurface = 0
  209. trace.BottomSurface = 0
  210. trace.formFactor = 3
  211. trace.Size = Vector3.new(.2, .2, distance)
  212. trace.BrickColor = BrickColor.new(col)
  213. trace.Transparency = trans
  214. trace.CFrame = CFrame.new(pos2, pos) * CFrame.new(0, 0, -distance/2)
  215. return trace
  216. end
  217. clearWelds(char.Torso)
  218. local back1 = prop("Part1", .1, .7, .5, 0, 0, 0, false, false, "Black", char, false)
  219. local back1weld = weld(char.Torso, back1, CFrame.new(1, -2, .6) * CFrame.Angles(math.rad(90), math.rad(20), math.rad(90)), CFrame.new(), char.Torso)
  220. local back2 = prop("Part2", .1, .2, .1, 0, 0, 0, false, false, "Grime", char, false)
  221. local back2weld = weld(back1, back2, CFrame.new(0, -.25, -.35), CFrame.new(), char.Torso)
  222. local back3 = prop("Part3", .1, .5, 1, 0, 0, 0, false, false, "Grime", char, false)
  223. local back3weld = weld(back1, back3, CFrame.new(0, .1, -.75), CFrame.new(), char.Torso)
  224. local back4 = prop("Part4", .1, .1, 1, 0, 0, 0, false, false, "Grime", char, false)
  225. local back4weld = weld(back3, back4, CFrame.new(0, .3, 0), CFrame.new(), char.Torso)
  226. local back5 = prop("Part5", .1, .1, .7, 0, 0, 0, false, false, "Grime", char, false)
  227. local back5weld = weld(back1, back5, CFrame.new(0, .4, -1.6), CFrame.new(), char.Torso)
  228. local trigger1 = prop("Part6", .1, .1, .6, 0, 0, 0, false, false, "Grime", char, false)
  229. local trigger1weld = weld(back4, trigger1, CFrame.new(0, -.6, -.4) * CFrame.Angles(-math.rad(30), 0, 0), CFrame.new(), char.Torso)
  230. local trigger2 = prop("Part7", .1, .1, .5, 0, 0, 0, false, false, "Grime", char, false)
  231. local trigger2weld = weld(back4, trigger2, CFrame.new(0, -.675, -.8) * CFrame.Angles(math.rad(15), 0, 0), CFrame.new(), char.Torso)
  232. local trigger3 = prop("Part8", .1, .1, .7, 0, 0, 0, false, false, "Grime", char, false)
  233. local trigger3weld = weld(back4, trigger3, CFrame.new(0, -.4, -.95) * CFrame.Angles(math.rad(90), 0, 0), CFrame.new(), char.Torso)
  234. local middle1 = prop("Part9", .1, .1, 1, 0, 0, 0, false, false, "Black", char, true, "Brick", .1, .0, .1, "", "") -- dis
  235. local middle1weld = weld(back5, middle1, CFrame.new(0, .05, -.8), CFrame.new(), char.Torso)
  236. local trigframe = prop("Part10", .1, .3, .3, 0, 0, 0, false, false, "Grime", char, true, "FileMesh", .3, .3, .3, "http://www.roblox.com/asset/?id=3270017", "")
  237. local trigframeweld = weld(back5, trigframe, CFrame.new(0, -.2, -.3) * CFrame.Angles(0, math.rad(90), 0), CFrame.new(), char.Torso)
  238. local middle2 = prop("Part11", .1, .3, 2, 0, 0, 0, false, false, "Grime", char, false)
  239. local middle2weld = weld(middle1, middle2, CFrame.new(0, -.1, -.4), CFrame.new(), char.Torso)
  240. local barrel = prop("Part12", .1, .1, 4, 0, 0, 0, false, false, "Black", char, true, "Brick", .5, .5, 1, "", "")
  241. local barrelweld = weld(middle1, barrel, CFrame.new(0, -.05, -2), CFrame.new(), char.Torso)
  242. local barrel2 = prop("Part13", barrelsize, 2, barrelsize, 0, 0, 0, false, false, "Black", char, false) Instance.new("CylinderMesh", barrel2)
  243. local barrel2weld = weld(barrel, barrel2, CFrame.new(0, 0, -2.5) * CFrame.Angles(math.rad(90), 0, 0), CFrame.new(), char.Torso)
  244. local scope1 = prop("Part14", .1, .2, .1, 0, 0, 0, false, false, "Black", char, true, "Brick", .5, .5, .5, "", "")
  245. local scope1weld = weld(middle1, scope1, CFrame.new(0, .1, .25), CFrame.new(), char.Torso)
  246. local scope2 = prop("Part14", .1, .2, .1, 0, 0, 0, false, false, "Black", char, true, "Brick", .5, .5, .5, "", "")
  247. local scope2weld = weld(middle1, scope2, CFrame.new(0, .1, -.25), CFrame.new(), char.Torso)
  248. local scope3 = prop("Part15", .1, 1.5, .1, 0, 0, 0, false, false, "Black", char, false) Instance.new("CylinderMesh", scope3)
  249. local scope3weld = weld(middle1, scope3, CFrame.new(0, .2, 0) * CFrame.Angles(math.rad(90), 0, 0), CFrame.new(), char.Torso)
  250. local scope4 = prop("Part16", .2, .3, .2, 0, 0, 0, false, false, "Black", char, true, "FileMesh", .2, .3, .2, "http://www.roblox.com/asset/?id=1033714", "")
  251. local scope4weld = weld(middle1, scope4, CFrame.new(0, .2, .7) * CFrame.Angles(math.rad(270), 0, 0), CFrame.new(), char.Torso)
  252. local scope5 = prop("Part17", .3, .35, .3, 0, 0, 0, false, false, "Black", char, true, "FileMesh", .3, .35, .3, "http://www.roblox.com/asset/?id=1033714", "")
  253. local scope5weld = weld(middle1, scope5, CFrame.new(0, .2, -.7) * CFrame.Angles(math.rad(-270), 0, 0), CFrame.new(), char.Torso)
  254. local rarmweld = weld(char.Torso, nil, CFrame.new(1.5, 0, 0), CFrame.new(), char.Torso)
  255. local larmweld = weld(char.Torso, nil, CFrame.new(-1.5, 0, 0), CFrame.new(), char.Torso)
  256. local gyro = Instance.new("BodyGyro", char.Torso)
  257. gyro.P = 10000
  258. gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  259. pmouse.Move:connect(function()
  260. gyro.cframe = CFrame.new(char.Torso.Position, Vector3.new(pmouse.Hit.p.X, char.Torso.Position.Y, pmouse.Hit.p.Z))
  261. end)
  262. function onEquip(mouse)
  263. repeat wait() until etemp and temp
  264. etemp = false
  265. rarmweld.Part1 = char["Right Arm"]
  266. local frame = 1
  267. coroutine.wrap(function()
  268. while rarmweld and animations.requip[frame] do
  269. rarmweld.C0 = interpolateCFrame(rarmweld.C0, animations.requip[frame])
  270. if rarmweld.C0 == animations.requip[frame] then
  271. frame = frame + 1
  272. else
  273. wait()
  274. end
  275. end
  276. end)()
  277. repeat wait() until frame == 3
  278. back1weld.Part0 = nil
  279. handleweld = weld(char["Right Arm"], back1, CFrame.new(-.5, 1, -.3) * CFrame.Angles(math.rad(270), 0, 0), CFrame.new(), char.Torso)
  280. repeat wait() until frame == 5
  281. larmweld.Part1 = char["Left Arm"]
  282. local frame2 = 1
  283. coroutine.wrap(function()
  284. while larmweld and animations.lequip[frame2] do
  285. larmweld.C0 = interpolateCFrame(larmweld.C0, animations.lequip[frame2])
  286. if larmweld.C0 == animations.lequip[frame2] then
  287. frame2 = frame2 + 1
  288. else
  289. wait()
  290. end
  291. end
  292. etemp = true
  293. end)()
  294. repeat wait() until frame == 6
  295. mouse.Button1Down:connect(function()
  296. if not temp then return end
  297. temp = false
  298. local frame3 = 1
  299. coroutine.wrap(function()
  300. while rarmweld and animations.rshoot[frame3] do
  301. rarmweld.C0 = interpolateCFrame(rarmweld.C0, animations.rshoot[frame3])
  302. if rarmweld.C0 == animations.rshoot[frame3] then
  303. frame3 = frame3 + 1
  304. else
  305. wait()
  306. end
  307. end
  308. end)()
  309. local frame4 = 1
  310. coroutine.wrap(function()
  311. while larmweld and animations.lshoot[frame4] do
  312. larmweld.C0 = interpolateCFrame(larmweld.C0, animations.lshoot[frame4])
  313. if larmweld.C0 == animations.lshoot[frame4] then
  314. frame4 = frame4 + 1
  315. else
  316. wait()
  317. end
  318. end
  319. wait(.1)
  320. temp = true
  321. end)()
  322. local ray = Ray.new(barrel2.Position, (mouse.Hit.p - barrel2.Position).unit * 500)
  323. sound(2, "http://www.roblox.com/Asset/?id=16211041", barrel2):play()
  324. local hit, pos = workspace:FindPartOnRay(ray, char)
  325. if hit and hit.Parent:FindFirstChild("Humanoid") then
  326. local dmg = math.random(70, 100)
  327. if hit.Name ~= "Head" then
  328. hit.Parent.Humanoid:TakeDamage(dmg)
  329. hit.Parent.Humanoid.Sit = true
  330. else
  331. hit.Parent:BreakJoints()
  332. sound(1, "http://www.roblox.com/asset/?id=1876552", workspace):play()
  333. end
  334. if game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) == nil then return end
  335. local bl = Instance.new("Part", workspace)
  336. bl.Name = "Blood"
  337. bl.BrickColor = BrickColor.new("Really red")
  338. bl.FormFactor = 3
  339. bl.TopSurface = 0
  340. bl.BottomSurface = 0
  341. bl.Size = Vector3.new(1, .1, 1)
  342. bl.Position = hit.Parent.Head.Position + Vector3.new(0, 3, 0)
  343. local bbg = Instance.new("BillboardGui", bl)
  344. bbg.Adornee = bl
  345. bbg.Size = UDim2.new(1, 0, 1, 0)
  346. bbg.StudsOffset = Vector3.new(0, 1, 0)
  347. local txt = Instance.new("TextLabel", bbg)
  348. txt.Position = UDim2.new(0.5, 0, 0.5, 0)
  349. txt.FontSize = "Size14"
  350. txt.TextColor3 = Color3.new(1, 1, 1)
  351. txt.Text = hit.Name ~= "Head" and dmg or "HEADSHOT"
  352. coroutine.wrap(fade)(bl, 0.005)
  353. end
  354. if hit and hit.Parent:IsA("Hat") then
  355. hit:BreakJoints()
  356. end
  357. Spawn(function()
  358. local tr = traceRay(barrel2.Position, pos, "White", .5)
  359. fade(tr, .01)
  360. end)
  361. repeat wait() until frame4 == 3
  362. sound(1, "http://roblox.com/asset/?id=10209881", middle2):play()
  363. end)
  364. end
  365. function onUnequip()
  366. repeat wait() until etemp and temp
  367. etemp = false
  368. local frame = 1
  369. coroutine.wrap(function()
  370. while rarmweld and animations.runequip[frame] do
  371. rarmweld.C0 = interpolateCFrame(rarmweld.C0, animations.runequip[frame])
  372. if rarmweld.C0 == animations.runequip[frame] then
  373. frame = frame + 1
  374. else
  375. wait()
  376. end
  377. end
  378. etemp = true
  379. end)()
  380. coroutine.wrap(function()
  381. while larmweld do
  382. larmweld.C0 = interpolateCFrame(larmweld.C0, CFrame.new(-1.5, 0, 0))
  383. if larmweld.C0 == CFrame.new(-1.5, 0, 0) then
  384. break
  385. else
  386. wait()
  387. end
  388. end
  389. end)()
  390. repeat wait() until frame == 4
  391. handleweld:Remove()
  392. back1weld:Remove()
  393. back1weld = weld(char.Torso, back1, CFrame.new(1, -2, .6) * CFrame.Angles(math.rad(90), math.rad(20), math.rad(90)), CFrame.new(), char.Torso)
  394. repeat wait() until frame == 7
  395. rarmweld.Part1 = nil
  396. larmweld.Part1 = nil
  397. end
  398. bin.Selected:connect(onEquip)
  399. bin.Deselected:connect(onUnequip)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement