vibrantsinger423

shirtgern

May 29th, 2019
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.30 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 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
  5.  
  6.  
  7. local Player = game:GetService("Players").LocalPlayer
  8. Character=Player.Character
  9.  
  10. Torso=Character.Torso
  11. Head = Character.Head
  12. LeftArm=Character["Left Arm"]
  13. LeftLeg=Character["Left Leg"]
  14. RightArm=Character["Right Arm"]
  15. RightLeg=Character["Right Leg"]
  16.  
  17. LS=Torso["Left Shoulder"]
  18. LH=Torso["Left Hip"]
  19. RS=Torso["Right Shoulder"]
  20. RH=Torso["Right Hip"]
  21. Neck=Torso.Neck
  22.  
  23. local idle=0
  24. local Anim="Idle"
  25. attack=false
  26.  
  27. vt=Vector3.new
  28. cf=CFrame.new
  29. euler=CFrame.fromEulerAnglesXYZ
  30. angles=CFrame.Angles
  31. cloaked=false
  32. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  33. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  34. LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  35. LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
  36. RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  37. RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
  38. RootPart=Character.HumanoidRootPart
  39. RootJoint=RootPart.RootJoint
  40. RootCF=euler(-1.57,0,3.14)
  41.  
  42.  
  43.  
  44. mouse=Player:GetMouse()
  45. it = Instance.new
  46. euler=CFrame.fromEulerAnglesXYZ
  47. angles=CFrame.Angles
  48. local RbxUtility = LoadLibrary("RbxUtility")
  49. local Create = RbxUtility.Create
  50. local m = Create("Model"){
  51. Parent = Character,
  52. Name = "WeaponModel",
  53. }
  54.  
  55. function nooutline(part)
  56. part.TopSurface,part.BottomSurface,part.LeftSurface,part.RightSurface,part.FrontSurface,part.BackSurface = 10,10,10,10,10,10
  57. end
  58.  
  59. function part(formfactor,parent,material,reflectance,transparency,brickcolor,name,size)
  60. local fp=it("Part")
  61. fp.formFactor=formfactor
  62. fp.Parent=parent
  63. fp.Reflectance=reflectance
  64. fp.Transparency=transparency
  65. fp.CanCollide=false
  66. fp.Locked=true
  67. fp.BrickColor=BrickColor.new(tostring(brickcolor))
  68. fp.Name=name
  69. fp.Size=size
  70. fp.Position=Character.Torso.Position
  71. nooutline(fp)
  72. fp.Material=material
  73. fp:BreakJoints()
  74. return fp
  75. end
  76.  
  77. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  78. local mesh=it(Mesh)
  79. mesh.Parent=part
  80. if Mesh=="SpecialMesh" then
  81. mesh.MeshType=meshtype
  82. mesh.MeshId=meshid
  83. end
  84. mesh.Offset=offset
  85. mesh.Scale=scale
  86. return mesh
  87. end
  88.  
  89. function weld(parent,part0,part1,c0,c1)
  90. local weld=it("Weld")
  91. weld.Parent=parent
  92. weld.Part0=part0
  93. weld.Part1=part1
  94. weld.C0=c0
  95. weld.C1=c1
  96. return weld
  97. end
  98.  
  99. local modeloe=Instance.new("Model")
  100. modeloe.Parent=Character
  101. modeloe.Name="Shotgun"
  102.  
  103. Part=part(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,("Black"),"Part",Vector3.new(1, 1, -10)) -- forward, up, left, rotation?, angle up,
  104. Partweld=weld(m,Part2,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(3,0,-0,-1,-1,-1,0,10,0,0,0,1))
  105. shotgun=mesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/Asset/?id=2166741820",Vector3.new(0,0,0),Vector3.new(2.01, 2.01,2.01))
  106.  
  107. Part2=part(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,("Dark blue"),"Part",Vector3.new(1, 0, -2)) -- forward, up, left, rotation?, angle up,
  108. firePiece=weld(m,Character["Torso"],Part2,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1,0,-0,-1,-0,-1,0,1,0,0,0,1))
  109. --------------------------------
  110. local Weld = Instance.new("Weld")
  111. Weld.Part0 = Torso
  112. Weld.Part1 = Part
  113. Weld.Parent = Torso
  114.  
  115. local RA = Character["Right Arm"]
  116.  
  117. local Part0Joint = CFrame.new(Vector3.new(1,8.75,0)*1.25)
  118. local Part1Joint = CFrame.new(Vector3.new(-0.5,0.75,0)*1.25)
  119. local RotationOffset = CFrame.Angles(math.rad(360),math.rad(0),0)
  120. local Gangster = false
  121.  
  122. local Part0JointHead = CFrame.new(Vector3.new(0,1,0)*1.25)
  123. local Part1JointHead = CFrame.new(Vector3.new(0,-0.5,0)*1.25)
  124. local RotationOffsetHead = CFrame.Angles(0,0,0)
  125.  
  126. game:GetService("RunService"):BindToRenderStep("Shotgun",Enum.RenderPriority.Character.Value,function()
  127. local Point = Torso.CFrame:vectorToObjectSpace(mouse.Hit.p-Torso.CFrame.p)
  128. if Point.Z > 0 then
  129. if Point.X > 0 then
  130. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(90),0)
  131. elseif Point.X < 0 then
  132. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(-90),0)
  133. end
  134. end
  135.  
  136. local CFr = (Torso.CFrame*Part0Joint):toObjectSpace(CFrame.new((Torso.CFrame*Part0Joint).p,mouse.Hit.p))--RayEnd))
  137. Weld.C0 = Part0Joint * (CFr-CFr.p) * RotationOffset
  138. Weld.C1 = Part1Joint
  139. Weld.Part0 = Torso
  140. Weld.Part1 = Part
  141. end)
  142. -------------------------------------
  143.  
  144. function Fire2()
  145. attack = true
  146. for i = 1,5 do
  147. LaserBarrage(shotgun.Parent) --(CFrame.new(0,-5,-5.5,-10,-0,-1,0,1,0,0,0,1))
  148. CreateSound("rbxassetid://3074576931", Head, 3, 0.8)
  149. end
  150. wait(1.5)
  151. attack = false
  152. end
  153.  
  154. mouse.KeyDown:connect(function(k)
  155. k = k:lower()
  156. if k == "g" and attack==false then
  157. Fire2()
  158. end
  159. end)
  160.  
  161. function swait(num)
  162. if num==0 or num==nil then
  163. game:service'RunService'.Heartbeat:wait(0)
  164. else
  165. for i=0,num do
  166. game:service'RunService'.Heartbeat:wait(0)
  167. end
  168. end
  169. end
  170.  
  171. function CreateSound(id, par, vol, pit)
  172. coroutine.resume(coroutine.create(function()
  173. local sou = Create("Sound"){
  174. Parent = par or workspace,
  175. Volume = vol,
  176. Pitch = pit or 1,
  177. SoundId = id,
  178. }
  179. wait()
  180. sou:play()
  181. end))
  182. end
  183.  
  184. function LaserBarrage(Prt,Parent)
  185. --attack=true
  186. local efprt=part(3,Parent,"Neon",0,0.5,BrickColor.new("Bright green"),"Effect",vt(0.2,0.2,0.2))
  187. efprt.Anchored=true
  188. local efmsh=mesh("CylinderMesh",efprt,"","",vt(0,0,0),vt(1,1,1))
  189. local spread=vt((math.random(-1,0)+math.random())*7,(math.random(-1,0)+math.random())*7,(math.random(-1,0)+math.random())*7)*(Prt.Position-mouse.Hit.p).magnitude/40
  190. coroutine.resume(coroutine.create(function(Part,Mesh,Spreaded)
  191. game:GetService("Debris"):AddItem(Part,6)
  192. local TheHit=mouse.Hit.p
  193. local MouseLook=cf((Prt.Position+TheHit)/2,TheHit+Spreaded/16)
  194. local hit,pos = rayCast(Prt.Position,MouseLook.lookVector,1000,Parent)
  195. local tefprt=part(3,workspace,"Neon",0,1,BrickColor.new("Black"),"Effect",vt(0.2,0.2,0.2))
  196. tefprt.CFrame=cf(pos)
  197. MagicCircle(BrickColor.new("Neon orange"),cf(pos),0.5,0.5,0.5,0.5,0.5,0.5,0.04)
  198. game:GetService("Debris"):AddItem(tefprt,3)
  199. Part.CFrame=CFrame.new((Prt.Position+pos)/2,pos)*angles(1.57,0,0)
  200. if(hit.Parent:FindFirstChild("Humanoid")~= nil)then
  201. if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Name ~= "Base" and hit.Parent.Name ~= Player.Name then
  202. hit.Parent.Humanoid:TakeDamage(1000)
  203. hit.Parent.Humanoid:Destroy()
  204. end
  205. end
  206. local mag=(Prt.Position-pos).magnitude
  207. MagicCylinder(BrickColor.new("White"),Part.CFrame,1,mag*5,0.5,0.05,0,0.5,0.05)
  208. Part.Parent=nil
  209. end),efprt,efmsh,spread)
  210. end
  211.  
  212. so = function(id,par,vol,pit)
  213. coroutine.resume(coroutine.create(function()
  214. local sou = Instance.new("Sound",par or workspace)
  215. sou.Volume=vol
  216. sou.Pitch=pit or 1
  217. sou.SoundId=id
  218. swait()
  219. sou:play()
  220. game:GetService("Debris"):AddItem(sou,6)
  221. end))
  222. end
  223.  
  224. function MagicCylinder(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  225. local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt(0.2,0.2,0.2))
  226. prt.Anchored=true
  227. prt.CFrame=cframe
  228. msh=mesh("SpecialMesh",prt,"Head","",vt(0,0,0),vt(x1,y1,z1))
  229. game:GetService("Debris"):AddItem(prt,2)
  230. coroutine.resume(coroutine.create(function(Part,Mesh)
  231. for i=0,1,delay do
  232. swait()
  233. Part.CFrame=Part.CFrame
  234. Part.Transparency=i
  235. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  236. end
  237. Part.Parent=nil
  238. end),prt,msh)
  239. end
  240.  
  241. function MagicCircle(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  242. local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  243. prt.Anchored=true
  244. prt.CFrame=cframe
  245. prt.CanCollide = false
  246. msh=mesh("SpecialMesh",prt,"Sphere","",vt(0,0,0),vt(x1,y1,z1))
  247. game:GetService("Debris"):AddItem(prt,2)
  248. coroutine.resume(coroutine.create(function(Part,Mesh)
  249. for i=0,1,delay do
  250. swait()
  251. Part.CFrame=Part.CFrame
  252. Part.Transparency=i
  253. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  254. end
  255. Part.Parent=nil
  256. end),prt,msh)
  257. end
  258.  
  259. function rayCast(Pos, Dir, Max, Ignore)
  260. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  261. end
Advertisement
Add Comment
Please, Sign In to add comment