Advertisement
samuelrichter66

shotgun face

Mar 18th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.34 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end
  6.  
  7.  
  8.  
  9.  
  10. local plr = game.Players.LocalPlayer
  11. local char = plr.Character
  12. local mouse = plr:GetMouse()
  13. local torso = char.Torso
  14. local head = char.Head
  15. local ra = char["Right Arm"]
  16. local la = char["Left Arm"]
  17. local rl = char["Right Leg"]
  18. local ll = char["Left Leg"]
  19. local human = char["Humanoid"]
  20. local camera = workspace.CurrentCamera
  21. local rs = torso:findFirstChild("Right Shoulder")
  22. local ls = torso:findFirstChild("Left Shoulder")
  23. local neck = torso:findFirstChild("Neck")
  24. local NO_moar_shooting = false
  25. local RunService = game:service'RunService'
  26. local ammo = 8
  27.  
  28.  
  29. local sound = Instance.new("Sound", head)
  30. sound.SoundId = "http://roblox.com/asset/?id=10209842"
  31. sound.Volume = 1
  32. local reloads = Instance.new("Sound", head)
  33. reloads.SoundId = "http://roblox.com/asset/?id=10209636"
  34. reloads.Volume = 1
  35. local activate = Instance.new("Sound", head)
  36. activate.SoundId = "http://roblox.com/asset/?id=10209894"
  37. activate.Volume = 1
  38.  
  39.  
  40. local equipped = false
  41.  
  42. local debounce = false
  43.  
  44. local face = head.face
  45.  
  46.  
  47. release = Instance.new("Part", nil)
  48. release.FormFactor = "Custom"
  49. release.Size = Vector3.new(0.3, 1.7, 0.3)
  50. release.BrickColor = BrickColor.Black()
  51. local weld = Instance.new("Weld", release)
  52. weld.Part0 = release
  53. release.Locked = true
  54. weld.Part1 = head
  55. weld.C0 = CFrame.new(0, -0.5, -0.2) * CFrame.Angles(math.pi/2, 0, 0)
  56. local mesh = Instance.new("CylinderMesh", release)
  57.  
  58. release2 = Instance.new("Part", nil)
  59. release2.FormFactor = "Custom"
  60. release2.Size = Vector3.new(0.2, 1.4, 0.2)
  61. release2.BrickColor = BrickColor.Black()
  62. release2.Locked = true
  63. local weld2 = Instance.new("Weld", release2)
  64. weld2.Part0 = release2
  65. weld2.Part1 = head
  66. weld2.C0 = CFrame.new(0, -0.5, 0) * CFrame.Angles(math.pi/2, 0, 0)
  67. local mesh2 = Instance.new("CylinderMesh", release2)
  68.  
  69. headext = Instance.new("Part", nil)
  70. headext.Position = torso.Position
  71. headext.FormFactor = "Custom"
  72. headext.Transparency = 1
  73. headext:BreakJoints()
  74. headext.Size = Vector3.new(2, 1, 1)
  75. headextw = Instance.new("Weld", headext)
  76. headextw.C0 = CFrame.new(Vector3.new(0, 1.5, 0))
  77. headextw.Part0 = torso
  78. headextw.Part1 = headext
  79. headextw.C1 = CFrame.new()
  80. headweld = Instance.new("Weld", headext)
  81. game:service("RunService").Stepped:connect(function()
  82. headweld.C0 = CFrame.new(Vector3.new(0,0,0), torso.CFrame:pointToObjectSpace(mouse.Hit.p)) * CFrame.Angles(0, 0, 0)
  83. end)
  84. headweld.Part0 = headext
  85. headweld.C1 = CFrame.new()
  86. headweld.Part1 = head
  87.  
  88. local Screen = Instance.new("ScreenGui", plr:findFirstChild("PlayerGui"))
  89. local TextBox = Instance.new("TextLabel", Screen)
  90. TextBox.Position = UDim2.new(0.1, 0, 0.95, 0)
  91. TextBox.Size = UDim2.new(0, 200, 0.05, 0)
  92. TextBox.BackgroundTransparency = 1
  93. game:service'RunService'.Stepped:connect(function()
  94. TextBox.Text = ("Ammo: "..ammo)
  95. end)
  96. TextBox.Font = "SourceSansBold"
  97. TextBox.TextColor3 = Color3.new(1, 1, 1)
  98. TextBox.FontSize = "Size36"
  99. TextBox.TextStrokeTransparency = 0
  100.  
  101. local pl = Instance.new("PointLight", release)
  102. pl.Range = 16
  103. pl.Brightness = 5
  104. pl.Color = Color3.new(1, 199/255, 67/255)
  105. pl.Enabled = false
  106. function reload()
  107. if ammo > 7 then return end
  108. reloads:play()
  109. ammo = ammo + 1
  110. activate:play()
  111. wait(0.3)
  112. debounce = false
  113. end
  114.  
  115. mouse.KeyDown:connect(function(key)
  116. if key == "r" then
  117. if debounce then return end
  118. if not equipped then return end
  119. if ammo > 7 then return end
  120. debounce = true
  121. reload()
  122. end
  123.  
  124. if key == "q" then
  125. equipped = not equipped
  126. if equipped then
  127. headext.Parent = char
  128. release.Parent = char
  129. release2.Parent = char
  130. face.Parent = nil
  131. for scale = 0, 1, 0.2 do
  132. weld2.C0 = CFrame.new(0, -scale + 0.5, 0) * CFrame.Angles(math.pi/2, 0, 0)
  133. weld.C0 = CFrame.new(0, -scale + 0.5, -0.2) * CFrame.Angles(math.pi/2, 0, 0)
  134. mesh.Scale = Vector3.new(1, scale, 1)
  135. mesh2.Scale = Vector3.new(1, scale, 1)
  136. wait()
  137. end
  138. else
  139. face.Parent = head
  140. release.Parent = nil
  141. release2.Parent = nil
  142. headext.Parent = nil
  143. end
  144. end
  145. end)
  146.  
  147. mouse.Button1Down:connect(function()
  148. if not equipped then return end
  149. if ammo < 1 then return end
  150. if debounce then return end
  151. debounce = true
  152. sound:play()
  153. pl.Enabled = true
  154. ammo = ammo - 1
  155. coroutine.wrap(function()
  156. wait(0.07)
  157. pl.Enabled = false
  158. end)()
  159. coroutine.wrap(function()
  160. for scale = 0.7, 1, 0.1 do
  161. mesh.Scale = Vector3.new(1, scale, 1)
  162. wait()
  163. end
  164. end)()
  165.  
  166. local shell = Instance.new("Part", workspace)
  167. shell.BrickColor = BrickColor.Red()
  168. shell.FormFactor = "Custom"
  169. shell.Size = Vector3.new(0.3, 0.7, 0.3)
  170. shell.CFrame = head.CFrame * CFrame.new(0, 0.1, 0.5) * CFrame.Angles(math.pi/2, 0, math.pi/2)
  171. local bodyF = Instance.new("BodyVelocity", shell)
  172. bodyF.maxForce = Vector3.new(1e5, 0, 1e5)
  173. bodyF.P = 1e3
  174. bodyF.velocity = head.CFrame.lookVector * -20
  175. Instance.new("CylinderMesh", shell)
  176.  
  177. local shell2 = Instance.new("Part", shell)
  178. shell2.BrickColor = BrickColor.Yellow()
  179. shell2.FormFactor = "Custom"
  180. shell2.Size = Vector3.new(0.3, 0.2, 0.3)
  181. shell2:BreakJoints()
  182. local weld = Instance.new("Weld", shell2)
  183. weld.Part0 = shell2
  184. weld.Part1 = shell
  185. weld.C0 = CFrame.new(0, 0.45, 0)
  186. Instance.new("CylinderMesh", shell2)
  187. coroutine.wrap(function()
  188. wait(0.2)
  189. bodyF:Destroy()
  190. wait(4.8)
  191.  
  192. for _ = 0, 5 do
  193. shell.Mesh.Scale = shell.Mesh.Scale + Vector3.new(0.2, 0.2, 0.2)
  194. shell.Transparency = shell.Transparency + 0.2
  195. shell2.Mesh.Scale = shell.Mesh.Scale + Vector3.new(0.2, 0.2, 0.2)
  196. shell2.Transparency = shell.Transparency + 0.2
  197. wait()
  198. end
  199.  
  200. shell:Destroy()
  201. end)()
  202.  
  203. for bullet = 0, 5 do
  204. coroutine.wrap(function()
  205. if char.Humanoid.Health < 1 then return end
  206. local rayPart = Instance.new("Part")
  207. rayPart.Name = "RayPart"
  208. rayPart.BrickColor = BrickColor.Yellow()
  209. rayPart.Anchored = true
  210. rayPart.CanCollide = false
  211. rayPart.Locked = true
  212. rayPart.TopSurface = Enum.SurfaceType.Smooth
  213. rayPart.BottomSurface = Enum.SurfaceType.Smooth
  214. rayPart.formFactor = Enum.FormFactor.Custom
  215. rayPart.Size = Vector3.new(0.2, 0.2, 4)
  216. Instance.new("BlockMesh", rayPart).Scale = Vector3.new(0.2, 0.2, 0.5)
  217.  
  218.  
  219.  
  220. local bulletposition = release.Position
  221. local bulletvelocity = (Vector3.new(math.random(-7,7), math.random(-7,7), math.random(-7,7)))+( mouse.Hit.p - bulletposition).unit*150
  222. local bulletlastposition = bulletposition
  223. rayPart.CFrame = CFrame.new( bulletposition, bulletposition+bulletvelocity )
  224.  
  225.  
  226.  
  227.  
  228.  
  229. coroutine.resume(coroutine.create(function()
  230. while true do
  231. local dt = wait()
  232. bulletlastposition = bulletposition
  233. bulletvelocity = bulletvelocity + (Vector3.new(0, -9.81*10, 0)*dt)
  234. bulletposition = bulletposition + (bulletvelocity*dt)
  235. rayPart.Parent = workspace
  236.  
  237. local ray = Ray.new(bulletlastposition, (bulletposition - bulletlastposition))
  238. local hit, hitposition = workspace:FindPartOnRayWithIgnoreList( ray, { char, rayPart} )
  239.  
  240. if (torso.Position - rayPart.Position).magnitude > 440 then
  241. rayPart:Destroy()
  242. break
  243. end
  244.  
  245.  
  246. if hit then
  247. local damage = math.random(6, 11)
  248. if hit.Parent:findFirstChild("Humanoid") ~= nil then
  249. hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage
  250. coroutine.wrap(function()
  251. local prt = Instance.new("Part", char)
  252. prt.FormFactor = "Custom"
  253. prt.Size = Vector3.new(0.1, 0.1, 0.1)
  254. prt.Transparency = 1
  255. prt.CanCollide = false
  256. prt.CFrame = CFrame.new(rayPart.CFrame.x, rayPart.CFrame.y, rayPart.CFrame.z)
  257. prt.Anchored = true
  258. coroutine.resume(coroutine.create(function()
  259. for i = 2, 10, 0.1 do
  260. if prt == nil then return end
  261. prt.CFrame = prt.CFrame * CFrame.new(0, 0.05, 0)
  262. game:service'RunService'.Stepped:wait()
  263. end
  264. end))
  265.  
  266. local bg = Instance.new("BillboardGui")
  267. bg.Parent = prt
  268. bg.Adornee = prt
  269. bg.Size = UDim2.new(4, 0, 3.5, 0)
  270. bg.ExtentsOffset = Vector3.new(0, 0, 0)
  271. local lol = Instance.new("TextLabel")
  272. lol.Size = UDim2.new(1.3, 0, 0.4, 0)
  273. lol.TextScaled = true
  274. lol.TextWrapped = true
  275. lol.BackgroundTransparency = 1
  276. lol.Parent = bg
  277. lol.FontSize = "Size24"
  278. lol.TextColor3 = Color3.new(1, 0, 0)
  279. lol.TextStrokeTransparency = 0
  280. lol.Font = "ArialBold"
  281. lol.Text = "-"..damage
  282.  
  283. wait(3)
  284. prt:Destroy()
  285. end)()
  286. end
  287. if hit.Parent:IsA("Hat") and hit.Parent.Parent:findFirstChild("Humanoid") ~= nil then
  288. hit.Parent.Parent.Humanoid.Health = hit.Parent.Parent.Humanoid.Health - damage
  289. coroutine.wrap(function()
  290. local prt = Instance.new("Part", char)
  291. prt.FormFactor = "Custom"
  292. prt.Size = Vector3.new(0.1, 0.1, 0.1)
  293. prt.Transparency = 1
  294. prt.CanCollide = false
  295. prt.CFrame = CFrame.new(rayPart.CFrame.x, rayPart.CFrame.y, rayPart.CFrame.z)
  296. prt.Anchored = true
  297. coroutine.resume(coroutine.create(function()
  298. for i = 2, 10, 0.1 do
  299. if prt == nil then return end
  300. prt.CFrame = prt.CFrame * CFrame.new(0, 0.05, 0)
  301. game:service'RunService'.Stepped:wait()
  302. end
  303. end))
  304.  
  305. local bg = Instance.new("BillboardGui")
  306. bg.Parent = prt
  307. bg.Adornee = prt
  308. bg.Size = UDim2.new(4, 0, 3.5, 0)
  309. bg.ExtentsOffset = Vector3.new(0, 0, 0)
  310. local lol = Instance.new("TextLabel")
  311. lol.Size = UDim2.new(1.3, 0, 0.4, 0)
  312. lol.TextScaled = true
  313. lol.TextWrapped = true
  314. lol.BackgroundTransparency = 1
  315. lol.Parent = bg
  316. lol.FontSize = "Size24"
  317. lol.TextColor3 = Color3.new(1, 0, 0)
  318. lol.TextStrokeTransparency = 0
  319. lol.Font = "ArialBold"
  320. lol.Text = "-"..damage
  321.  
  322. wait(3)
  323. prt:Destroy()
  324. end)()
  325. end
  326. bulletposition = hitposition
  327. rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity)
  328. rayPart:Destroy()
  329. break
  330. end
  331. rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity)
  332. end
  333. end))
  334. end)()
  335. end
  336. wait(0.3)
  337. debounce = false
  338.  
  339. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement