Advertisement
HoneyBadger69

Untitled

Jun 17th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.04 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 barrelsize = .3
  123. local handleweld = nil
  124. local temp = true
  125. local etemp = true
  126. bin.Name = "L96A1 Magnum"
  127. function weld(part0, part1, c0, c1, parent)
  128. local w = Instance.new("Weld", parent)
  129. w.Part0 = part0
  130. w.Part1 = part1
  131. w.C0 = c0
  132. w.C1 = c1
  133. w.Name = "NewWeld"
  134. return w
  135. end
  136. function interpolateCFrame(cf1, cf2)
  137. local t1 = {cf1:components()}
  138. local t2 = {cf2:components()}
  139. local newcf = {}
  140. for i, v in pairs(t1) do
  141. local dif = t2[i] - v
  142. if i < 4 then
  143. local newValue = nil
  144. if math.abs(dif) < .1 then
  145. newValue = t2[i]
  146. else
  147. newValue = v + ((dif/math.abs(dif)) * .1)
  148. end
  149. newcf[i] = newValue
  150. else
  151. local newValue = nil
  152. if math.abs(dif) < .1 then
  153. newValue = t2[i]
  154. else
  155. newValue = v + ((dif/math.abs(dif)) * .1)
  156. end
  157. newcf[i] = newValue
  158. end
  159. end
  160. return CFrame.new(unpack(newcf))
  161. end
  162. function prop(name, sx, sy, sz, px, py, pz, anc, canc, col, par, mesh, meshtype, scalex, scaley, scalez, meshid, textureid)
  163. local part = Instance.new("Part", par)
  164. part.Name = name
  165. part.TopSurface = 0
  166. part.BottomSurface = 0
  167. part.formFactor = 3
  168. part.Size = Vector3.new(sx, sy, sz)
  169. part.Position = Vector3.new(px, py, pz)
  170. part.Anchored = anc
  171. part.CanCollide = canc
  172. part.BrickColor = BrickColor.new(col)
  173. if mesh then
  174. local m = Instance.new("SpecialMesh", part)
  175. m.MeshType = meshtype
  176. m.MeshId = meshid
  177. m.Scale = Vector3.new(scalex, scaley, scalez)
  178. m.TextureId = textureid
  179. end
  180. return part
  181. end
  182. function fade(part, speed)
  183. for i = part.Transparency, 1, speed do
  184. part.Transparency = i
  185. wait()
  186. end
  187. part:Destroy()
  188. end
  189. function clearWelds(par)
  190. for i, v in pairs(par:GetChildren()) do
  191. if v.Name == "NewWeld" and v:IsA("Weld") then
  192. v:Destroy()
  193. end
  194. end
  195. end
  196. function sound(pitch, id, par)
  197. local s = Instance.new("Sound", par)
  198. s.Pitch = pitch
  199. s.SoundId = id
  200. return s
  201. end
  202. function traceRay(pos, pos2, col, trans)
  203. local distance = (pos - pos2).magnitude
  204. local trace = Instance.new("Part", char)
  205. trace.Anchored = true
  206. trace.CanCollide = false
  207. trace.TopSurface = 0
  208. trace.BottomSurface = 0
  209. trace.formFactor = 3
  210. trace.Size = Vector3.new(.2, .2, distance)
  211. trace.BrickColor = BrickColor.new(col)
  212. trace.Transparency = trans
  213. trace.CFrame = CFrame.new(pos2, pos) * CFrame.new(0, 0, -distance/2)
  214. return trace
  215. end
  216. clearWelds(char.Torso)
  217. local back1 = prop("Part1", .1, .7, .5, 0, 0, 0, false, false, "Black", char, false)
  218. 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)
  219. local back2 = prop("Part2", .1, .2, .1, 0, 0, 0, false, false, "Grime", char, false)
  220. local back2weld = weld(back1, back2, CFrame.new(0, -.25, -.35), CFrame.new(), char.Torso)
  221. local back3 = prop("Part3", .1, .5, 1, 0, 0, 0, false, false, "Grime", char, false)
  222. local back3weld = weld(back1, back3, CFrame.new(0, .1, -.75), CFrame.new(), char.Torso)
  223. local back4 = prop("Part4", .1, .1, 1, 0, 0, 0, false, false, "Grime", char, false)
  224. local back4weld = weld(back3, back4, CFrame.new(0, .3, 0), CFrame.new(), char.Torso)
  225. local back5 = prop("Part5", .1, .1, .7, 0, 0, 0, false, false, "Grime", char, false)
  226. local back5weld = weld(back1, back5, CFrame.new(0, .4, -1.6), CFrame.new(), char.Torso)
  227. local trigger1 = prop("Part6", .1, .1, .6, 0, 0, 0, false, false, "Grime", char, false)
  228. local trigger1weld = weld(back4, trigger1, CFrame.new(0, -.6, -.4) * CFrame.Angles(-math.rad(30), 0, 0), CFrame.new(), char.Torso)
  229. local trigger2 = prop("Part7", .1, .1, .5, 0, 0, 0, false, false, "Grime", char, false)
  230. local trigger2weld = weld(back4, trigger2, CFrame.new(0, -.675, -.8) * CFrame.Angles(math.rad(15), 0, 0), CFrame.new(), char.Torso)
  231. local trigger3 = prop("Part8", .1, .1, .7, 0, 0, 0, false, false, "Grime", char, false)
  232. local trigger3weld = weld(back4, trigger3, CFrame.new(0, -.4, -.95) * CFrame.Angles(math.rad(90), 0, 0), CFrame.new(), char.Torso)
  233. local middle1 = prop("Part9", .1, .1, 1, 0, 0, 0, false, false, "Black", char, true, "Brick", .1, .0, .1, "", "") -- dis
  234. local middle1weld = weld(back5, middle1, CFrame.new(0, .05, -.8), CFrame.new(), char.Torso)
  235. 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", "")
  236. local trigframeweld = weld(back5, trigframe, CFrame.new(0, -.2, -.3) * CFrame.Angles(0, math.rad(90), 0), CFrame.new(), char.Torso)
  237. local middle2 = prop("Part11", .1, .3, 2, 0, 0, 0, false, false, "Grime", char, false)
  238. local middle2weld = weld(middle1, middle2, CFrame.new(0, -.1, -.4), CFrame.new(), char.Torso)
  239. local barrel = prop("Part12", .1, .1, 4, 0, 0, 0, false, false, "Black", char, true, "Brick", .5, .5, 1, "", "")
  240. local barrelweld = weld(middle1, barrel, CFrame.new(0, -.05, -2), CFrame.new(), char.Torso)
  241. local barrel2 = prop("Part13", barrelsize, 2, barrelsize, 0, 0, 0, false, false, "Black", char, false) Instance.new("CylinderMesh", barrel2)
  242. local barrel2weld = weld(barrel, barrel2, CFrame.new(0, 0, -2.5) * CFrame.Angles(math.rad(90), 0, 0), CFrame.new(), char.Torso)
  243. local scope1 = prop("Part14", .1, .2, .1, 0, 0, 0, false, false, "Black", char, true, "Brick", .5, .5, .5, "", "")
  244. local scope1weld = weld(middle1, scope1, CFrame.new(0, .1, .25), CFrame.new(), char.Torso)
  245. local scope2 = prop("Part14", .1, .2, .1, 0, 0, 0, false, false, "Black", char, true, "Brick", .5, .5, .5, "", "")
  246. local scope2weld = weld(middle1, scope2, CFrame.new(0, .1, -.25), CFrame.new(), char.Torso)
  247. local scope3 = prop("Part15", .1, 1.5, .1, 0, 0, 0, false, false, "Black", char, false) Instance.new("CylinderMesh", scope3)
  248. local scope3weld = weld(middle1, scope3, CFrame.new(0, .2, 0) * CFrame.Angles(math.rad(90), 0, 0), CFrame.new(), char.Torso)
  249. 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", "")
  250. local scope4weld = weld(middle1, scope4, CFrame.new(0, .2, .7) * CFrame.Angles(math.rad(270), 0, 0), CFrame.new(), char.Torso)
  251. 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", "")
  252. local scope5weld = weld(middle1, scope5, CFrame.new(0, .2, -.7) * CFrame.Angles(math.rad(-270), 0, 0), CFrame.new(), char.Torso)
  253. local rarmweld = weld(char.Torso, nil, CFrame.new(1.5, 0, 0), CFrame.new(), char.Torso)
  254. local larmweld = weld(char.Torso, nil, CFrame.new(-1.5, 0, 0), CFrame.new(), char.Torso)
  255. local gyro = Instance.new("BodyGyro", char.Torso)
  256. gyro.P = 10000
  257. gyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  258. end)
  259. function onEquip(mouse)
  260. repeat wait() until etemp and temp
  261. etemp = false
  262. rarmweld.Part1 = char["Right Arm"]
  263. local frame = 1
  264. coroutine.wrap(function()
  265. while rarmweld and animations.requip[frame] do
  266. rarmweld.C0 = interpolateCFrame(rarmweld.C0, animations.requip[frame])
  267. if rarmweld.C0 == animations.requip[frame] then
  268. frame = frame + 1
  269. else
  270. wait()
  271. end
  272. end
  273. end)()
  274. repeat wait() until frame == 3
  275. back1weld.Part0 = nil
  276. handleweld = weld(char["Right Arm"], back1, CFrame.new(-.5, 1, -.3) * CFrame.Angles(math.rad(270), 0, 0), CFrame.new(), char.Torso)
  277. repeat wait() until frame == 5
  278. larmweld.Part1 = char["Left Arm"]
  279. local frame2 = 1
  280. coroutine.wrap(function()
  281. while larmweld and animations.lequip[frame2] do
  282. larmweld.C0 = interpolateCFrame(larmweld.C0, animations.lequip[frame2])
  283. if larmweld.C0 == animations.lequip[frame2] then
  284. frame2 = frame2 + 1
  285. else
  286. wait()
  287. end
  288. end
  289. etemp = true
  290. end)()
  291. repeat wait() until frame == 6
  292. mouse.Button1Down:connect(function()
  293. if not temp then return end
  294. temp = false
  295. local frame3 = 1
  296. coroutine.wrap(function()
  297. while rarmweld and animations.rshoot[frame3] do
  298. rarmweld.C0 = interpolateCFrame(rarmweld.C0, animations.rshoot[frame3])
  299. if rarmweld.C0 == animations.rshoot[frame3] then
  300. frame3 = frame3 + 1
  301. else
  302. wait()
  303. end
  304. end
  305. end)()
  306. local frame4 = 1
  307. coroutine.wrap(function()
  308. while larmweld and animations.lshoot[frame4] do
  309. larmweld.C0 = interpolateCFrame(larmweld.C0, animations.lshoot[frame4])
  310. if larmweld.C0 == animations.lshoot[frame4] then
  311. frame4 = frame4 + 1
  312. else
  313. wait()
  314. end
  315. end
  316. wait(.1)
  317. temp = true
  318. end)()
  319. local ray = Ray.new(barrel2.Position, (mouse.Hit.p - barrel2.Position).unit * 500)
  320. sound(2, "http://www.roblox.com/Asset/?id=16211041", barrel2):play()
  321. local hit, pos = workspace:FindPartOnRay(ray, char)
  322. if hit and hit.Parent:FindFirstChild("Humanoid") then
  323. local dmg = math.random(70, 100)
  324. if hit.Name ~= "Head" then
  325. hit.Parent.Humanoid:TakeDamage(dmg)
  326. hit.Parent.Humanoid.Sit = true
  327. else
  328. hit.Parent:BreakJoints()
  329. sound(1, "http://www.roblox.com/asset/?id=1876552", workspace):play()
  330. end
  331. if game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) == nil then return end
  332. local bl = Instance.new("Part", workspace)
  333. bl.Name = "Blood"
  334. bl.BrickColor = BrickColor.new("Really red")
  335. bl.FormFactor = 3
  336. bl.TopSurface = 0
  337. bl.BottomSurface = 0
  338. bl.Size = Vector3.new(1, .1, 1)
  339. bl.Position = hit.Parent.Head.Position + Vector3.new(0, 3, 0)
  340. local bbg = Instance.new("BillboardGui", bl)
  341. bbg.Adornee = bl
  342. bbg.Size = UDim2.new(1, 0, 1, 0)
  343. bbg.StudsOffset = Vector3.new(0, 1, 0)
  344. local txt = Instance.new("TextLabel", bbg)
  345. txt.Position = UDim2.new(0.5, 0, 0.5, 0)
  346. txt.FontSize = "Size14"
  347. txt.TextColor3 = Color3.new(1, 1, 1)
  348. txt.Text = hit.Name ~= "Head" and dmg or "HEADSHOT"
  349. coroutine.wrap(fade)(bl, 0.005)
  350. end
  351. if hit and hit.Parent:IsA("Hat") then
  352. hit:BreakJoints()
  353. end
  354. Spawn(function()
  355. local tr = traceRay(barrel2.Position, pos, "White", .5)
  356. fade(tr, .01)
  357. end)
  358. repeat wait() until frame4 == 3
  359. sound(1, "http://roblox.com/asset/?id=10209881", middle2):play()
  360. end)
  361. end
  362. function onUnequip()
  363. repeat wait() until etemp and temp
  364. etemp = false
  365. local frame = 1
  366. coroutine.wrap(function()
  367. while rarmweld and animations.runequip[frame] do
  368. rarmweld.C0 = interpolateCFrame(rarmweld.C0, animations.runequip[frame])
  369. if rarmweld.C0 == animations.runequip[frame] then
  370. frame = frame + 1
  371. else
  372. wait()
  373. end
  374. end
  375. etemp = true
  376. end)()
  377. coroutine.wrap(function()
  378. while larmweld do
  379. larmweld.C0 = interpolateCFrame(larmweld.C0, CFrame.new(-1.5, 0, 0))
  380. if larmweld.C0 == CFrame.new(-1.5, 0, 0) then
  381. break
  382. else
  383. wait()
  384. end
  385. end
  386. end)()
  387. repeat wait() until frame == 4
  388. handleweld:Remove()
  389. back1weld:Remove()
  390. 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)
  391. repeat wait() until frame == 7
  392. rarmweld.Part1 = nil
  393. larmweld.Part1 = nil
  394. end
  395. bin.Selected:connect(onEquip)
  396. bin.Deselected:connect(onUnequip)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement