Advertisement
Void_scripter0

shotgun

Jan 15th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.54 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. print("FE Compatibility code by Mokiros | Showcase by Bacon Hair!")
  6. local rp = RealPlayer
  7. script.Parent = rp.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent then
  33. for _,f in pairs(t.Functions) do
  34. f(...)
  35. end
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=rp then return end
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. if not io.isMouse then
  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 Mouse = Player:GetMouse()
  66. local UIS = game:GetService("UserInputService")
  67. local input = function(io,a)
  68. if a then return end
  69. --Since InputObject is a client-side instance, we create and pass table instead
  70. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  71. end
  72. UIS.InputBegan:Connect(input)
  73. UIS.InputEnded:Connect(input)
  74.  
  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.  
  85. ----Sandboxed game object that allows the usage of client-side methods and services
  86. --Real game object
  87. local _rg = game
  88.  
  89. --Metatable for fake service
  90. local fsmt = {
  91. __index = function(self,k)
  92. local s = rawget(self,"_RealService")
  93. if s then return s[k] end
  94. end,
  95. __newindex = function(self,k,v)
  96. local s = rawget(self,"_RealService")
  97. if s then s[k]=v end
  98. end,
  99. __call = function(self,...)
  100. local s = rawget(self,"_RealService")
  101. if s then return s(...) end
  102. end
  103. }
  104. local function FakeService(t,RealService)
  105. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106. return setmetatable(t,fsmt)
  107. end
  108.  
  109. --Fake game object
  110. local g = {
  111. GetService = function(self,s)
  112. return self[s]
  113. end,
  114. Players = FakeService({
  115. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116. },"Players"),
  117. UserInputService = FakeService(UIS,"UserInputService"),
  118. ContextActionService = FakeService(CAS,"ContextActionService"),
  119. }
  120. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  121. g.service = g.GetService
  122.  
  123. g.RunService = FakeService({
  124. RenderStepped = _rg:GetService("RunService").Heartbeat,
  125. BindToRenderStep = function(self,name,_,fun)
  126.  
  127. end,
  128. UnbindFromRenderStep = function(self,name)
  129. self._btrs[name]:Disconnect()
  130. end,
  131. },"RunService")
  132.  
  133. setmetatable(g,{
  134. __index=function(self,s)
  135. return _rg:GetService(s) or typeof(_rg[s])=="function"
  136. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  137. end,
  138. __newindex = fsmt.__newindex,
  139. __call = fsmt.__call
  140. })
  141. --Changing owner to fake player object to support owner:GetMouse()
  142. game,owner = g,g.Players.LocalPlayer
  143. end
  144. --By Rufus14
  145. --ears: 391268255
  146. --bamalam: 720451528
  147. --columb: 1202637744
  148. music = Instance.new("Sound", game.Players.LocalPlayer.Character.Torso)
  149. music.Volume = 0
  150. music.SoundId = "rbxassetid://0"
  151. music.Looped = true
  152. music:Play()
  153. mouse = game.Players.LocalPlayer:GetMouse()
  154. gun = Instance.new("Part", game.Players.LocalPlayer.Character)
  155. gun:BreakJoints()
  156. gun.CanCollide = false
  157. gun.Name = "Shotgun"
  158. mesh = Instance.new("SpecialMesh", gun)
  159. mesh.MeshId = "rbxassetid://477037714"
  160. mesh.TextureId = "rbxassetid://477037796"
  161. mesh.Scale = Vector3.new(0.03,0.03,0.03)
  162. weld = Instance.new("Weld", gun)
  163. weld.Part0 = game.Players.LocalPlayer.Character["Right Arm"]
  164. weld.Part1 = gun
  165. weld.C0 = weld.C0 * CFrame.Angles(-1.5,0,0) * CFrame.new(0,0,-2.5)
  166. local rhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
  167. rhandweld.Part0 = game.Players.LocalPlayer.Character.Torso
  168. rhandweld.Part1 = game.Players.LocalPlayer.Character["Right Arm"]
  169. rhandweld.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  170. local lhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
  171. lhandweld.Part0 = game.Players.LocalPlayer.Character.Torso
  172. lhandweld.Part1 = game.Players.LocalPlayer.Character["Left Arm"]
  173. lhandweld.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  174. shot = Instance.new("Sound", gun)
  175. shot.Volume = 10
  176. shot.SoundId = "rbxassetid://185044507"
  177. pump = Instance.new("Sound", gun)
  178. pump.Volume = 10
  179. pump.SoundId = "rbxassetid://255061173"
  180. pump.PlaybackSpeed = 0.7
  181. function owtheedge()
  182. workspace.CurrentCamera.FieldOfView = 70 + music.PlaybackLoudness / 80
  183. end
  184. game:GetService("RunService").RenderStepped:connect(owtheedge)
  185. for i = 0,0.7 , 0.01 do
  186. weld.C0 = weld.C0:lerp(CFrame.new(-0.342021942, -1.88848877, -0.088739872, 0.978147507, -0.0289359875, -0.205888897, 0.204753578, -0.0378959738, 0.978079677, -0.0361040607, -0.998862624, -0.0311431047),i)
  187. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.917564392, 0.399175882, -0.578536987, 0.978147507, 0.204753578, -0.0361040607, -0.0289359875, -0.0378959738, -0.998862624, -0.205888897, 0.978079677, -0.0311431047),i)
  188. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-0.472423553, 0.409558296, -1.4746933, 0.939692736, -0.342019886, -2.0985492e-06, 0.0238559935, 0.0655499771, -0.997564137, 0.341186911, 0.937403619, 0.0697560608),i)
  189. game:GetService("RunService").RenderStepped:wait()
  190. end
  191. using = false
  192. ammo = 5
  193. function shoot()
  194. if not using then
  195. using = true
  196. shot:Play()
  197. for i = 1,5 do
  198. local missle = Instance.new("Part", workspace)
  199. missle:BreakJoints()
  200. missle.Name = "bullet"
  201. missle.CanCollide = false
  202. missle.Material = "Neon"
  203. missle.Size = Vector3.new(0.1,0.1,0.1)
  204. missle.CFrame = gun.CFrame * CFrame.new(0,0,2)
  205. missle.Transparency = 1
  206. local vel = Instance.new("BodyVelocity", missle)
  207. vel.Velocity = mouse.Hit.lookVector * math.random(500,500) + Vector3.new(math.random(-50,50),math.random(-50,50),0)
  208. vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  209. local function hit(part)
  210. local hitval = math.random(25,40)
  211. local humanoid = part.Parent:findFirstChildOfClass("Humanoid")
  212. if humanoid then
  213. if humanoid.Health == math.huge or humanoid.Health >= 600 then
  214. humanoid.Health = 100
  215. end
  216. if humanoid.MaxHealth == math.huge or humanoid.MaxHealth >= 600 then
  217. humanoid.MaxHealth = 100
  218. end
  219. if humanoid.Parent.Name == game.Players.LocalPlayer.Name then
  220.  
  221. else
  222. if humanoid.Health < hitval then
  223. humanoid.JumpPower = 0
  224. humanoid.PlatformStand = true
  225. humanoid.WalkSpeed = 0
  226. local findlefthip = humanoid.Parent.Torso:findFirstChild("Left Hip")
  227. if findlefthip then
  228. findlefthip:Remove()
  229. local glue = Instance.new("Glue", humanoid.Parent.Torso)
  230. glue.Part0 = humanoid.Parent.Torso
  231. glue.Part1 = humanoid.Parent["Left Leg"]
  232. glue.Name = "Left leg"
  233. local collider = Instance.new("Part", humanoid.Parent["Left Leg"])
  234. collider.Position = Vector3.new(0,999,0)
  235. collider.Size = Vector3.new(1.5, 1, 1)
  236. collider.Shape = "Cylinder"
  237. local weld = Instance.new("Weld", collider)
  238. weld.Part0 = humanoid.Parent["Left Leg"]
  239. weld.Part1 = collider
  240. weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  241. collider.TopSurface = "Smooth"
  242. collider.BottomSurface = "Smooth"
  243. collider.formFactor = "Symmetric"
  244. glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  245. glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  246. collider.Transparency = 1
  247. end
  248. --
  249. local findrighthip = humanoid.Parent.Torso:findFirstChild("Right Hip")
  250. if findrighthip then
  251. findrighthip:Remove()
  252. local glue = Instance.new("Glue", humanoid.Parent.Torso)
  253. glue.Part0 = humanoid.Parent.Torso
  254. glue.Part1 = humanoid.Parent["Right Leg"]
  255. glue.Name = "Right leg"
  256. local collider = Instance.new("Part", humanoid.Parent["Right Leg"])
  257. collider.Position = Vector3.new(0,999,0)
  258. collider.Size = Vector3.new(1.5, 1, 1)
  259. collider.Shape = "Cylinder"
  260. local weld = Instance.new("Weld", collider)
  261. weld.Part0 = humanoid.Parent["Right Leg"]
  262. weld.Part1 = collider
  263. weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  264. collider.TopSurface = "Smooth"
  265. collider.BottomSurface = "Smooth"
  266. collider.formFactor = "Symmetric"
  267. glue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  268. glue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  269. collider.Transparency = 1
  270. end
  271. --
  272. local findrightshoulder = humanoid.Parent.Torso:findFirstChild("Right Shoulder")
  273. if findrightshoulder then
  274. findrightshoulder:Remove()
  275. local glue = Instance.new("Glue", humanoid.Parent.Torso)
  276. glue.Part0 = humanoid.Parent.Torso
  277. glue.Part1 = humanoid.Parent["Right Arm"]
  278. glue.Name = "Right arm"
  279. local collider = Instance.new("Part", humanoid.Parent["Right Arm"])
  280. collider.Position = Vector3.new(0,999,0)
  281. collider.Size = Vector3.new(1.5, 1, 1)
  282. collider.Shape = "Cylinder"
  283. local weld = Instance.new("Weld", collider)
  284. weld.Part0 = humanoid.Parent["Right Arm"]
  285. weld.Part1 = collider
  286. weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  287. collider.TopSurface = "Smooth"
  288. collider.BottomSurface = "Smooth"
  289. collider.formFactor = "Symmetric"
  290. glue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  291. glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  292. collider.Transparency = 1
  293. end
  294. --
  295. local findleftshoulder = humanoid.Parent.Torso:findFirstChild("Left Shoulder")
  296. if findleftshoulder then
  297. findleftshoulder:Remove()
  298. local glue = Instance.new("Glue", humanoid.Parent.Torso)
  299. glue.Part0 = humanoid.Parent.Torso
  300. glue.Part1 = humanoid.Parent["Left Arm"]
  301. glue.Name = "Left arm"
  302. local collider = Instance.new("Part", humanoid.Parent["Left Arm"])
  303. collider.Position = Vector3.new(0,999,0)
  304. collider.Size = Vector3.new(1.5, 1, 1)
  305. collider.Shape = "Cylinder"
  306. local weld = Instance.new("Weld", collider)
  307. weld.Part0 = humanoid.Parent["Left Arm"]
  308. weld.Part1 = collider
  309. weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
  310. collider.TopSurface = "Smooth"
  311. collider.BottomSurface = "Smooth"
  312. collider.formFactor = "Symmetric"
  313. glue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  314. glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  315. collider.Transparency = 1
  316. end
  317. local findhead = humanoid.Parent:findFirstChild("Head")
  318. if findhead then
  319. local attachment = Instance.new("Attachment", humanoid.Parent.Head)
  320. attachment.Position = Vector3.new(0, -0.5, 0)
  321. attachment.Name = "lol"
  322. attachment.Visible = false
  323. humanoid.Parent.Torso.NeckAttachment.Visible = false
  324. humanoid.Parent.Torso.NeckAttachment.Position = humanoid.Parent.Torso.NeckAttachment.Position + Vector3.new(0,0,0)
  325. local ball = Instance.new("BallSocketConstraint", humanoid.Parent)
  326. ball.Attachment0 = humanoid.Parent.Torso.NeckAttachment
  327. ball.Attachment1 = attachment
  328. ball.LimitsEnabled = true
  329. ball.TwistLimitsEnabled = true
  330. ball.UpperAngle = 90
  331. ball.Restitution = 0.5
  332. ball.TwistUpperAngle = 90
  333. ball.TwistLowerAngle = -90
  334. local collidepartofleftleg = Instance.new("Part", humanoid.Parent.Torso)
  335. collidepartofleftleg.Name = "Bone"
  336. collidepartofleftleg.Size = Vector3.new(0.7,0.7,0.7)
  337. collidepartofleftleg.Transparency = 1
  338. collidepartofleftleg:BreakJoints()
  339. local weeld = Instance.new("Weld", collidepartofleftleg)
  340. weeld.Part0 = collidepartofleftleg
  341. weeld.Part1 = humanoid.Parent["Head"]
  342. if humanoid.Parent.Torso:findFirstChild("Neck") then
  343. humanoid.Parent.Torso.Neck:destroy()
  344. end
  345. end
  346. wait(10)
  347. humanoid.Health = 0
  348. else
  349. humanoid.Health = humanoid.Health - hitval
  350. end
  351. end
  352. else
  353. if part.Name == "Shotgun" or "bullet" then
  354.  
  355. else
  356. missle:destroy()
  357. end
  358. end
  359. end
  360. missle.Touched:connect(hit)
  361. end
  362. for i = 0,1 , 0.07 do
  363. weld.C0 = weld.C0:lerp(CFrame.new(-0.342021942, -1.88848877, -0.088739872, 0.978147507, -0.0289359875, -0.205888897, 0.204753578, -0.0378959738, 0.978079677, -0.0361040607, -0.998862624, -0.0311431047),i)
  364. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.917564392, 0.491810799, -0.168943405, 0.978147507, 0.204753578, -0.0361040607, 0.0289353225, -0.306021929, -0.951584637, -0.205889001, 0.929745436, -0.305259228),i)
  365. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-0.472423553, 0.748803854, -1.02752113, 0.939693093, -0.342019022, -2.66768012e-07, -0.0711100101, -0.195373133, -0.978147566, 0.334545016, 0.919158578, -0.207911715),i)
  366. game:GetService("RunService").RenderStepped:wait()
  367. end
  368. for i = 0,1 , 0.05 do
  369. weld.C0 = weld.C0:lerp(CFrame.new(-0.342021942, -1.88848877, -0.088739872, 0.978147507, -0.0289359875, -0.205888897, 0.204753578, -0.0378959738, 0.978079677, -0.0361040607, -0.998862624, -0.0311431047),i)
  370. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.917564392, 0.491810799, -0.168943405, 0.978147507, 0.204753578, -0.0361040607, 0.0289353225, -0.306021929, -0.951584637, -0.205889001, 0.929745436, -0.305259228),i)
  371. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-0.201648712, 0.903478384, -1.75520706, 0.939693093, -0.342019022, -2.66768012e-07, -0.0711100101, -0.195373133, -0.978147566, 0.334545016, 0.919158578, -0.207911715),i)
  372. game:GetService("RunService").RenderStepped:wait()
  373. end
  374. pump:Play()
  375. for i = 0,1 , 0.05 do
  376. weld.C0 = weld.C0:lerp(CFrame.new(-0.342021942, -1.88848877, -0.088739872, 0.978147507, -0.0289359875, -0.205888897, 0.204753578, -0.0378959738, 0.978079677, -0.0361040607, -0.998862624, -0.0311431047),i)
  377. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.917564392, 0.491810799, -0.168943405, 0.978147507, 0.204753578, -0.0361040607, 0.0289353225, -0.306021929, -0.951584637, -0.205889001, 0.929745436, -0.305259228),i)
  378. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-0.44393158, 0.765078783, -1.10408783, 0.939693093, -0.342019022, -2.66768012e-07, -0.0711100101, -0.195373133, -0.978147566, 0.334545016, 0.919158578, -0.207911715),i)
  379. game:GetService("RunService").RenderStepped:wait()
  380. end
  381. for i = 0,1 , 0.05 do
  382. weld.C0 = weld.C0:lerp(CFrame.new(-0.342021942, -1.88848877, -0.088739872, 0.978147507, -0.0289359875, -0.205888897, 0.204753578, -0.0378959738, 0.978079677, -0.0361040607, -0.998862624, -0.0311431047),i)
  383. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.917564392, 0.491810799, -0.168943405, 0.978147507, 0.204753578, -0.0361040607, 0.0289353225, -0.306021929, -0.951584637, -0.205889001, 0.929745436, -0.305259228),i)
  384. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-0.201648712, 0.903478384, -1.75520706, 0.939693093, -0.342019022, -2.66768012e-07, -0.0711100101, -0.195373133, -0.978147566, 0.334545016, 0.919158578, -0.207911715),i)
  385. game:GetService("RunService").RenderStepped:wait()
  386. end
  387. for i = 0,0.7 , 0.04 do
  388. weld.C0 = weld.C0:lerp(CFrame.new(-0.342021942, -1.88848877, -0.088739872, 0.978147507, -0.0289359875, -0.205888897, 0.204753578, -0.0378959738, 0.978079677, -0.0361040607, -0.998862624, -0.0311431047),i)
  389. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.917564392, 0.399175882, -0.578536987, 0.978147507, 0.204753578, -0.0361040607, -0.0289359875, -0.0378959738, -0.998862624, -0.205888897, 0.978079677, -0.0311431047),i)
  390. lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-0.472423553, 0.409558296, -1.4746933, 0.939692736, -0.342019886, -2.0985492e-06, 0.0238559935, 0.0655499771, -0.997564137, 0.341186911, 0.937403619, 0.0697560608),i)
  391. game:GetService("RunService").RenderStepped:wait()
  392. end
  393. using = false
  394. end
  395. end
  396. mouse.Button1Down:connect(shoot)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement