Advertisement
vibrantsinger423

shottie3

May 31st, 2019
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.67 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. local Player = game:GetService("Players").LocalPlayer
  7. Character=Player.Character
  8. Humanoid=Character.Humanoid
  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. equipped=true
  24.  
  25. anim = Character:findFirstChild("Animate")
  26. if anim then
  27. anim:Destroy()
  28. end
  29.  
  30. local idle=0
  31. local Anim="Idle"
  32. attack=false
  33. overload=false
  34.  
  35. vt=Vector3.new
  36. cf=CFrame.new
  37. euler=CFrame.fromEulerAnglesXYZ
  38. angles=CFrame.Angles
  39. cloaked=false
  40. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  41. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  42. LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  43. LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
  44. RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  45. RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
  46. RootPart=Character.HumanoidRootPart
  47. RootJoint=RootPart.RootJoint
  48. RootCF=euler(-1.57,0,3.14)
  49.  
  50.  
  51.  
  52. mouse=Player:GetMouse()
  53. it = Instance.new
  54. euler=CFrame.fromEulerAnglesXYZ
  55. angles=CFrame.Angles
  56. local RbxUtility = LoadLibrary("RbxUtility")
  57. local Create = RbxUtility.Create
  58. local m = Create("Model"){
  59. Parent = Character,
  60. Name = "WeaponModel",
  61. }
  62.  
  63. function nooutline(part)
  64. part.TopSurface,part.BottomSurface,part.LeftSurface,part.RightSurface,part.FrontSurface,part.BackSurface = 10,10,10,10,10,10
  65. end
  66.  
  67. function part(formfactor,parent,material,reflectance,transparency,brickcolor,name,size)
  68. local fp=it("Part")
  69. fp.formFactor=formfactor
  70. fp.Parent=parent
  71. fp.Reflectance=reflectance
  72. fp.Transparency=transparency
  73. fp.CanCollide=false
  74. fp.Locked=true
  75. fp.BrickColor=BrickColor.new(tostring(brickcolor))
  76. fp.Name=name
  77. fp.Size=size
  78. fp.Position=Character.Torso.Position
  79. nooutline(fp)
  80. fp.Material=material
  81. fp:BreakJoints()
  82. return fp
  83. end
  84.  
  85. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  86. local mesh=it(Mesh)
  87. mesh.Parent=part
  88. if Mesh=="SpecialMesh" then
  89. mesh.MeshType=meshtype
  90. mesh.MeshId=meshid
  91. end
  92. mesh.Offset=offset
  93. mesh.Scale=scale
  94. return mesh
  95. end
  96.  
  97. function weld(parent,part0,part1,c0,c1)
  98. local weld=it("Weld")
  99. weld.Parent=parent
  100. weld.Part0=part0
  101. weld.Part1=part1
  102. weld.C0=c0
  103. weld.C1=c1
  104. return weld
  105. end
  106.  
  107. local modeloe=Instance.new("Model")
  108. modeloe.Parent=Character
  109. modeloe.Name="Shotgun"
  110.  
  111. Part=part(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,("Black"),"Part",Vector3.new(1, 1, -10)) -- forward, up, left, rotation?, angle up,
  112. 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))
  113. 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))
  114.  
  115. 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,
  116. 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))
  117. --------------------------------
  118. local Weld = Instance.new("Weld")
  119. Weld.Part0 = Torso
  120. Weld.Part1 = Part
  121. Weld.Parent = Torso
  122.  
  123. local Part0Joint = CFrame.new(Vector3.new(1,8.75,0)*1.25)
  124. local Part1Joint = CFrame.new(Vector3.new(-0.5,0.75,0)*1.25)
  125. local RotationOffset = CFrame.Angles(math.rad(360),math.rad(0),0)
  126. local Gangster = false
  127.  
  128. local Part0JointHead = CFrame.new(Vector3.new(0,1,0)*1.25)
  129. local Part1JointHead = CFrame.new(Vector3.new(0,-0.5,0)*1.25)
  130. local RotationOffsetHead = CFrame.Angles(0,0,0)
  131.  
  132. game:GetService("RunService"):BindToRenderStep("Shotgun",Enum.RenderPriority.Character.Value,function()
  133. local Point = Torso.CFrame:vectorToObjectSpace(mouse.Hit.p-Torso.CFrame.p)
  134. if Point.Z > 0 then
  135. if Point.X > 0 then
  136. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(90),0)
  137. elseif Point.X < 0 then
  138. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(-90),0)
  139. end
  140. end
  141.  
  142. local CFr = (Torso.CFrame*Part0Joint):toObjectSpace(CFrame.new((Torso.CFrame*Part0Joint).p,mouse.Hit.p))--RayEnd))
  143. Weld.C0 = Part0Joint * (CFr-CFr.p) * RotationOffset
  144. Weld.C1 = Part1Joint
  145. Weld.Part0 = Torso
  146. Weld.Part1 = Part
  147. end)
  148. -------------------------------------
  149.  
  150. ----------------------------------
  151. -----------------------------------
  152. function Damage(hit, damage, cooldown, Color1, Color2, HSound, HPitch)
  153. for i, v in pairs(hit:GetChildren()) do
  154. if v:IsA("Humanoid") and hit.Name ~= Character.Name then
  155. local find = v:FindFirstChild("Hitz")
  156. if not find then
  157. if v.Parent:findFirstChild("Head") then
  158. local BillG = Create("BillboardGui"){
  159. Parent = v.Parent.Head,
  160. Size = UDim2.new(1, 0, 1, 0),
  161. Adornee = v.Parent.Head,
  162. StudsOffset = Vector3.new(math.random(-3, 3), math.random(3, 5), math.random(-3, 3)),
  163. }
  164. local TL = Create("TextLabel"){
  165. Parent = BillG,
  166. Size = UDim2.new(3, 3, 3, 3),
  167. BackgroundTransparency = 1,
  168. Text = tostring(damage).."-",
  169. TextColor3 = Color1.Color,
  170. TextStrokeColor3 = Color2.Color,
  171. TextStrokeTransparency = 0,
  172. TextXAlignment = Enum.TextXAlignment.Center,
  173. TextYAlignment = Enum.TextYAlignment.Center,
  174. FontSize = Enum.FontSize.Size18,
  175. Font = "ArialBold",
  176. }
  177. coroutine.resume(coroutine.create(function()
  178. wait(1)
  179. for i = 0, 1, .1 do
  180. wait(.1)
  181. BillG.StudsOffset = BillG.StudsOffset + Vector3.new(0, .1, 0)
  182. end
  183. BillG:Destroy()
  184. end))
  185. end
  186. v.Health = v.Health - damage
  187. local bool = Create("BoolValue"){
  188. Parent = v,
  189. Name = 'Hitz',
  190. }
  191. if HSound ~= nil and HPitch ~= nil then
  192. CreateSound(HSound, hit, 1, HPitch)
  193. end
  194. game:GetService("Debris"):AddItem(bool, cooldown)
  195. end
  196. end
  197. end
  198. end
  199.  
  200. function rayCast(Pos, Dir, Max, Ignore)
  201. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  202. end
  203.  
  204.  
  205. Effects = { }
  206. function MagnitudeDamage(Part, magni, mindam, maxdam, Color1, Color2, HitSound)
  207. for _, c in pairs(workspace:children()) do
  208. local hum = c:findFirstChild("Humanoid")
  209. if hum ~= nil then
  210. local head = c:findFirstChild("Torso")
  211. if head ~= nil then
  212. local targ = head.Position - Part.Position
  213. local mag = targ.magnitude
  214. if mag <= magni and c.Name ~= Player.Name then
  215. Damage(head.Parent, math.random(mindam, maxdam), 0, Color1, Color2, HitSound, 1)
  216. end
  217. end
  218. end
  219. end
  220. end
  221.  
  222. function MagicBlock(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  223. local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt())
  224. prt.Anchored=true
  225. prt.CFrame=cframe
  226. msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
  227. game:GetService("Debris"):AddItem(prt,5)
  228. table.insert(Effects,{prt,"Block1",delay,x3,y3,z3}) --part, type, delay
  229. end
  230.  
  231.  
  232.  
  233. function MagicRing(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  234. local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  235. prt.Anchored=true
  236. prt.CFrame=cframe
  237. msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=3270017",vt(0,0,0),vt(x1,y1,z1))
  238. game:GetService("Debris"):AddItem(prt,2)
  239. coroutine.resume(coroutine.create(function(Part,Mesh,num)
  240. for i=0,1,delay do
  241. swait()
  242. Part.Transparency=i
  243. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  244. end
  245. Part.Parent=nil
  246. end),prt,msh,(math.random(0,1)+math.random())/5)
  247. end
  248.  
  249. function MagicBlockx(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  250. local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt())
  251. prt.Anchored=true
  252. prt.CFrame=cframe
  253. msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
  254. game:GetService("Debris"):AddItem(prt,5)
  255. table.insert(Effects,{prt,"Block1",delay,x3,y3,z3}) --part, type, delay
  256. end
  257.  
  258. function MagicCircle(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  259. local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  260. prt.Anchored=true
  261. prt.CFrame=cframe
  262. prt.CanCollide = false
  263. msh=mesh("SpecialMesh",prt,"Sphere","",vt(0,0,0),vt(x1,y1,z1))
  264. game:GetService("Debris"):AddItem(prt,2)
  265. coroutine.resume(coroutine.create(function(Part,Mesh)
  266. for i=0,1,delay do
  267. swait()
  268. Part.CFrame=Part.CFrame
  269. Part.Transparency=i
  270. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  271. end
  272. Part.Parent=nil
  273. end),prt,msh)
  274. end
  275. --------------------------------
  276. ----------------------------
  277.  
  278. function Spreadgun()
  279. attack = true
  280. for i = 1,5 do
  281. LaserBarrage(shotgun.Parent) --(CFrame.new(0,-5,-5.5,-10,-0,-1,0,1,0,0,0,1))
  282. end
  283. CreateSound("rbxassetid://3074576931", shotgun.Parent, 3, 0.8)
  284. wait(1.5)
  285. attack = false
  286. end
  287.  
  288. function Spreadgun2()
  289. attack = true
  290. for i = 1,5 do
  291. LaserBarrage2(shotgun.Parent) --(CFrame.new(0,-5,-5.5,-10,-0,-1,0,1,0,0,0,1))
  292. end
  293. CreateSound("rbxassetid://3074576931", shotgun.Parent, 3, 0.7)
  294. wait(1.8)
  295. attack = false
  296. end
  297.  
  298. function lazershell()
  299. attack = true
  300. --omsh.Scale=omsh.Scale+vt(0.5,0.5,0.5)
  301. local Pos=cf(shotgun.Parent.Position,Player:GetMouse().Hit.p).lookVector
  302. wait(.5)
  303. local hit,pos = rayCast(shotgun.Parent.Position,Pos,999,Character)
  304. local mag=(shotgun.Parent.Position-pos).magnitude
  305. MagicCircle(BrickColor.new("Neon orange"),cf(pos),15,15,15,8,8,8,0.02)
  306. MagicBlock(BrickColor.new("White"),cf(pos),15,15,15,8,8,8,0.02)
  307. MagicCylinder(BrickColor.new("White"),CFrame.new((shotgun.Parent.Position+pos)/2,pos)*euler(1.57,0,0),10,mag*5,10,0.5,0,0.5,0.01)
  308. for i=1,2 do
  309. MagicRing(BrickColor.new("Neon orange"),cf(pos)*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50)),3,3,3,1,1,1,0.04)
  310. end
  311. for i=1,5 do
  312. local tehcf=CFrame.new((shotgun.Parent.Position+pos)/2,pos)*euler(1.57,0,0)*cf(0,(mag/5)*(i/2),0)
  313. MagicRing(BrickColor.new("Really black"),tehcf*euler(1.57,0,0),1,1,1,0.5,0.5,0.5,0.01)
  314. end
  315. for i=0,5 do
  316. local tehcf=CFrame.new((shotgun.Parent.Position+pos)/2,pos)*euler(1.57,0,0)*cf(0,(-mag/5)*(i/2),0)
  317. MagicRing(BrickColor.new("Neon orange"),tehcf*euler(1.57,0,0),1,1,1,0.5,0.5,0.5,0.01)
  318. end
  319. local ref=part(3,workspace,"Neon",0,1,BrickColor.new("Really black"),"Effect",vt())
  320. ref.CFrame=cf(pos)
  321. so("http://roblox.com/asset/?id=203691378",Torso,3,0.6)
  322. so("http://roblox.com/asset/?id=169445602",Torso,3,0.6)
  323. so("http://www.roblox.com/Asset?ID=203691282",Torso,3,.7)
  324. coroutine.resume(coroutine.create(function(Part)
  325. Part.Parent=nil
  326. end),ref)
  327. if hit~=nil then
  328. MagnitudeDamage(ref, 40, 100, 200, BrickColor.new("Dark stone grey"), BrickColor.new("Navy blue") , "rbxassetid://199149297")
  329. attack = false
  330. end
  331. end
  332.  
  333. mouse.KeyDown:connect(function(k)
  334. k = k:lower()
  335. if k == "e" and attack==false and overload==false then
  336. Spreadgun()
  337. end
  338. if k == "q" and attack==false and overload==true then
  339. lazershell()
  340. end
  341. if k == "f" and attack==false and overload==false then
  342. Overload()
  343. end
  344. if k == "g" and attack==false and overload==true then
  345. Normal()
  346. end
  347. if k == "z" and attack==false and overload==true then
  348. Spreadgun2()
  349. end
  350. if k == "LeftShift" and attack==false and overload==false then
  351. Humanoid.WalkSpeed=(32)
  352. end
  353. end)
  354.  
  355. function swait(num)
  356. if num==0 or num==nil then
  357. game:service'RunService'.Heartbeat:wait(0)
  358. else
  359. for i=0,num do
  360. game:service'RunService'.Heartbeat:wait(0)
  361. end
  362. end
  363. end
  364.  
  365. function CreateSound(id, par, vol, pit)
  366. coroutine.resume(coroutine.create(function()
  367. local sou = Create("Sound"){
  368. Parent = par or workspace,
  369. Volume = vol,
  370. Pitch = pit or 1,
  371. SoundId = id,
  372. }
  373. wait()
  374. sou:play()
  375. end))
  376. end
  377.  
  378. function LaserBarrage(Prt,Parent)
  379. --attack=true
  380. local efprt=part(3,Parent,"Neon",0,0.5,BrickColor.new("Bright green"),"Effect",vt(0.2,0.2,0.2))
  381. efprt.Anchored=true
  382. local efmsh=mesh("CylinderMesh",efprt,"","",vt(0,0,0),vt(1,1,1))
  383. 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
  384. coroutine.resume(coroutine.create(function(Part,Mesh,Spreaded)
  385. game:GetService("Debris"):AddItem(Part,6)
  386. local TheHit=mouse.Hit.p
  387. local MouseLook=cf((Prt.Position+TheHit)/2,TheHit+Spreaded/16)
  388. local hit,pos = rayCast(Prt.Position,MouseLook.lookVector,1000,Parent)
  389. --local pos=rayCast(P.Parent.Position,Player:GetMouse().Hit.p).lookVector
  390. local tefprt=part(3,workspace,"Neon",0,1,BrickColor.new("Black"),"Effect",vt(0.2,0.2,0.2))
  391. tefprt.CFrame=cf(pos)
  392. MagicCircle(BrickColor.new("Neon orange"),cf(pos),0.5,0.5,0.5,0.5,0.5,0.5,0.04)
  393. game:GetService("Debris"):AddItem(tefprt,3)
  394. Part.CFrame=CFrame.new((Prt.Position+pos)/2,pos)*angles(1.57,0,0)
  395. if(hit.Parent:FindFirstChild("Humanoid")~= nil)then
  396. if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Name ~= "Base" and hit.Parent.Name ~= Player.Name then
  397. hit.Parent.Humanoid:TakeDamage(1000)
  398. hit.Parent.Humanoid.Parent:Destroy()
  399. end
  400. end
  401. local mag=(Prt.Position-pos).magnitude
  402. --MagicCylinder(BrickColor.new("Dark blue"),CFrame.new((shotgun.Parent.Position+pos)/2,pos)*euler(1.57,0,0),10,mag*5,10,0.5,0,0.5,0.01)
  403. --MagicCircle(BrickColor.new("Neon orange"),cf(pos),0.5,0.5,0.5,0.5,0.5,0.5,0.04)
  404. MagicCylinder(BrickColor.new("White"),Part.CFrame,1,mag*5,0.5,0.05,0,0.5,0.05)
  405. Part.Parent=nil
  406. end),efprt,efmsh,spread)
  407. end
  408.  
  409. function Machinegun(Prt,Parent)
  410. --attack=true
  411. local efprt=part(3,Parent,"Neon",0,0.5,BrickColor.new("Bright green"),"Effect",vt(0.2,0.2,0.2))
  412. efprt.Anchored=true
  413. local efmsh=mesh("CylinderMesh",efprt,"","",vt(0,0,0),vt(1,1,1))
  414. 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
  415. coroutine.resume(coroutine.create(function(Part,Mesh,Spreaded)
  416. game:GetService("Debris"):AddItem(Part,6)
  417. local TheHit=mouse.Hit.p
  418. local MouseLook=cf((Prt.Position+TheHit)/2,TheHit+Spreaded/17)
  419. local hit,pos = rayCast(Prt.Position,MouseLook.lookVector,1000,Parent)
  420. --local pos=rayCast(P.Parent.Position,Player:GetMouse().Hit.p).lookVector
  421. local tefprt=part(3,workspace,"Neon",0,1,BrickColor.new("Black"),"Effect",vt(0.2,0.2,0.2))
  422. tefprt.CFrame=cf(pos)
  423. MagicCircle(BrickColor.new("Neon orange"),cf(pos),0.5,0.5,0.5,0.5,0.5,0.5,0.02)
  424. game:GetService("Debris"):AddItem(tefprt,3)
  425. Part.CFrame=CFrame.new((Prt.Position+pos)/2,pos)*angles(1.57,0,0)
  426. if(hit.Parent:FindFirstChild("Humanoid")~= nil)then
  427. if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Name ~= "Base" and hit.Parent.Name ~= Player.Name then
  428. hit.Parent.Humanoid:TakeDamage(1000)
  429. hit.Parent.Humanoid.Parent:Destroy()
  430. end
  431. end
  432. end),efprt,efmsh,spread)
  433. end
  434.  
  435. function LaserBarrage2(Prt,Parent)
  436. --attack=true
  437. local efprt=part(3,Parent,"Neon",0,0.5,BrickColor.new("Bright green"),"Effect",vt(0.2,0.2,0.2))
  438. efprt.Anchored=true
  439. local efmsh=mesh("CylinderMesh",efprt,"","",vt(0,0,0),vt(1,1,1))
  440. 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
  441. coroutine.resume(coroutine.create(function(Part,Mesh,Spreaded)
  442. game:GetService("Debris"):AddItem(Part,6)
  443. local TheHit=mouse.Hit.p
  444. local MouseLook=cf((Prt.Position+TheHit)/2,TheHit+Spreaded/16)
  445. local hit,pos = rayCast(Prt.Position,MouseLook.lookVector,1000,Parent)
  446. --local pos=rayCast(P.Parent.Position,Player:GetMouse().Hit.p).lookVector
  447. local tefprt=part(3,workspace,"Neon",0,1,BrickColor.new("Black"),"Effect",vt(0.2,0.2,0.2))
  448. tefprt.CFrame=cf(pos)
  449. MagicCircle(BrickColor.new("Neon orange"),cf(pos),0.5,10.5,10.5,0.5,0.5,0.5,0.01)
  450. game:GetService("Debris"):AddItem(tefprt,3)
  451. Part.CFrame=CFrame.new((Prt.Position+pos)/2,pos)*angles(1.57,0,0)
  452. if(hit.Parent:FindFirstChild("Humanoid")~= nil)then
  453. if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Name ~= "Base" and hit.Parent.Name ~= Player.Name then
  454. hit.Parent.Humanoid:TakeDamage(1000)
  455. hit.Parent.Humanoid:Destroy()
  456. hit.Parent.Humanoid.Script:Destroy()
  457. end
  458. end
  459. local mag=(Prt.Position-pos).magnitude
  460. --MagicCylinder(BrickColor.new("Dark blue"),CFrame.new((shotgun.Parent.Position+pos)/2,pos)*euler(1.57,0,0),10,mag*5,10,0.5,0,0.5,0.01)
  461. --MagicCircle(BrickColor.new("Neon orange"),cf(pos),0.5,0.5,0.5,0.5,0.5,0.5,0.04)
  462. MagicCylinder(BrickColor.new("White"),Part.CFrame,1,mag*5,2.5,0.05,0,0.5,0.01)
  463. Part.Parent=nil
  464. end),efprt,efmsh,spread)
  465. end
  466.  
  467. so = function(id,par,vol,pit)
  468. coroutine.resume(coroutine.create(function()
  469. local sou = Instance.new("Sound",par or workspace)
  470. sou.Volume=vol
  471. sou.Pitch=pit or 1
  472. sou.SoundId=id
  473. swait()
  474. sou:play()
  475. game:GetService("Debris"):AddItem(sou,6)
  476. end))
  477. end
  478.  
  479. function MagicCylinder(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  480. local prt=part(3,workspace,"Neon",0,0,brickcolor,"Effect",vt(0.2,0.2,0.2))
  481. prt.Anchored=true
  482. prt.CFrame=cframe
  483. msh=mesh("SpecialMesh",prt,"Head","",vt(0,0,0),vt(x1,y1,z1))
  484. game:GetService("Debris"):AddItem(prt,2)
  485. coroutine.resume(coroutine.create(function(Part,Mesh)
  486. for i=0,1,delay do
  487. swait()
  488. Part.CFrame=Part.CFrame
  489. Part.Transparency=i
  490. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  491. end
  492. Part.Parent=nil
  493. end),prt,msh)
  494. end
  495.  
  496. function Overload()
  497. overload=true
  498. shotgun.Parent:Destroy()
  499. Part=part(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,("Black"),"Part",Vector3.new(1, 1, -10)) -- forward, up, left, rotation?, angle up,
  500. 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))
  501. shotgun=mesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/Asset/?id=2166741820",Vector3.new(0,0,0),Vector3.new(7.01, 7.01,7.01),CFrame.Angles(math.rad(360),math.rad(0),0))
  502. CreateSound("rbxassetid://142653441", shotgun.Parent, 5, 1)
  503.  
  504. local particleemitter = Instance.new("ParticleEmitter", shotgun.Parent)
  505. particleemitter.Texture = "http://www.roblox.com/asset/?id=321556991"
  506. particleemitter.ZOffset = Vector3.new(1,1,10)
  507. particleemitter.EmissionDirection = "Front"
  508. particleemitter.VelocitySpread = 10
  509. particleemitter.LockedToPart = true
  510. particleemitter.Lifetime = NumberRange.new(0.65)
  511. particleemitter.Speed = NumberRange.new(40)
  512. particleemitter.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(1, 5.563)})
  513. particleemitter.RotSpeed = NumberRange.new(-180, 180)
  514. particleemitter.Rate = 180
  515. particleemitter.Rotation = NumberRange.new(-45, 45)
  516. particleemitter.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(0.701, 0), NumberSequenceKeypoint.new(1, 1)})
  517. particleemitter.LightEmission = 0
  518. particleemitter.Color = ColorSequence.new(Color3.new(0, 0, 0), Color3.new(0, 0, 0))
  519. end
  520.  
  521. function Normal()
  522. overload=false
  523. shotgun.Parent:Destroy()
  524. Part=part(Enum.FormFactor.Custom,m,Enum.Material.Neon,0,0,("Black"),"Part",Vector3.new(1, 1, -10)) -- forward, up, left, rotation?, angle up,
  525. 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))
  526. 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))
  527. end
  528.  
  529. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  530. local xs, ys, zs = x + x, y + y, z + z
  531. local wx, wy, wz = w*xs, w*ys, w*zs
  532. local xx = x*xs
  533. local xy = x*ys
  534. local xz = x*zs
  535. local yy = y*ys
  536. local yz = y*zs
  537. local zz = z*zs
  538. return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
  539. end
  540.  
  541. function QuaternionFromCFrame(cf)
  542. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  543. local trace = m00 + m11 + m22
  544. if trace > 0 then
  545. local s = math.sqrt(1 + trace)
  546. local recip = 0.5/s
  547. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  548. else
  549. local i = 0
  550. if m11 > m00 then
  551. i = 1
  552. end
  553. if m22 > (i == 0 and m00 or m11) then
  554. i = 2
  555. end
  556. if i == 0 then
  557. local s = math.sqrt(m00-m11-m22+1)
  558. local recip = 0.5/s
  559. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  560. elseif i == 1 then
  561. local s = math.sqrt(m11-m22-m00+1)
  562. local recip = 0.5/s
  563. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  564. elseif i == 2 then
  565. local s = math.sqrt(m22-m00-m11+1)
  566. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  567. end
  568. end
  569. end
  570.  
  571. function QuaternionSlerp(a, b, t)
  572. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  573. local startInterp, finishInterp;
  574. if cosTheta >= 0.0001 then
  575. if (1 - cosTheta) > 0.0001 then
  576. local theta = math.acos(cosTheta)
  577. local invSinTheta = 1/math.sin(theta)
  578. startInterp = math.sin((1-t)*theta)*invSinTheta
  579. finishInterp = math.sin(t*theta)*invSinTheta
  580. else
  581. startInterp = 1-t
  582. finishInterp = t
  583. end
  584. else
  585. if (1+cosTheta) > 0.0001 then
  586. local theta = math.acos(-cosTheta)
  587. local invSinTheta = 1/math.sin(theta)
  588. startInterp = math.sin((t-1)*theta)*invSinTheta
  589. finishInterp = math.sin(t*theta)*invSinTheta
  590. else
  591. startInterp = t-1
  592. finishInterp = t
  593. end
  594. end
  595. return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp
  596. end
  597.  
  598. function clerp(a,b,t)
  599. local qa = {QuaternionFromCFrame(a)}
  600. local qb = {QuaternionFromCFrame(b)}
  601. local ax, ay, az = a.x, a.y, a.z
  602. local bx, by, bz = b.x, b.y, b.z
  603. local _t = 1-t
  604. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  605. end
  606.  
  607. local sine = 0
  608. local change = 1
  609. local val = 0
  610.  
  611. RW, LW=Instance.new("Weld"), Instance.new("Weld")
  612. RW.Name="Right Shoulder" LW.Name="Left Shoulder"
  613.  
  614. local mananum=0
  615. while true do
  616. swait()
  617. sine = sine + change
  618. local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude
  619. local velderp=RootPart.Velocity.y
  620. hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,4,Character)
  621.  
  622. if torvel<1 and hitfloor~=nil then
  623. Anim="Idle"
  624. change=0.5
  625. if true==true then
  626. if attack==false then
  627. Humanoid.WalkSpeed=12
  628. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,6-0.25*math.cos(sine/5))*angles(math.rad(0),math.rad(0),math.rad(10)),.1)
  629. Neck.C0=clerp(Neck.C0,necko*angles(math.rad(5+2*math.cos(sine/5.5)),math.rad(-5-2*math.cos(sine/5.5)),math.rad(-50)),.1)
  630. Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.1)
  631. RW.C0=clerp(RW.C0,cf(0.8,0.3,-0.5)*angles(math.rad(70),math.rad(0),math.rad(-85)),.5)
  632. LW.C0=clerp(LW.C0,cf(-0.6,0.5,-0.7)*angles(math.rad(70),math.rad(0),math.rad(85)),.5)
  633. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0)),.1)
  634. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(0),math.rad(0)),.1)
  635. end
  636. else
  637. if attack==false then
  638. Humanoid.WalkSpeed=12
  639. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(6),math.rad(0),math.rad(0)),.3)
  640. Neck.C0=clerp(Neck.C0,necko*angles(math.rad(3+3*math.cos(sine/36)),math.rad(0),math.rad(0)),.3)
  641. Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.3)
  642. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*angles(math.rad(10),math.rad(0),math.rad(16-6*math.cos(sine/28))),.3)
  643. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*angles(math.rad(10),math.rad(0),math.rad(-16+6*math.cos(sine/28))),.3)
  644. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(16)),.3)
  645. LH.C0=clerp(LH.C0,cf(-1,-1.1,0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(24)),.3)
  646. end
  647. end
  648. --[[
  649. elseif torvel>2 and torvel<22 and hitfloor~=nil then
  650. Anim="Walk"
  651. if attack==false then
  652. change=0.8
  653. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)*angles(math.rad(35),math.rad(0),math.rad(15*math.cos(sine/10))),.3)
  654. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(-30),math.rad(0),math.rad(0)),.3)
  655. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*angles(math.rad(-135*math.cos(sine/9)),math.rad(0),math.rad(0)),.3)
  656. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*angles(math.rad(135*math.cos(sine/9)),math.rad(0),math.rad(0)),.3)
  657. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0)),.3)
  658. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3)
  659. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,0),.2)
  660. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(0.1,0,0),.2)
  661. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*euler(-0.1,0,0.2),.2)
  662. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*angles(math.rad(-5),math.rad(-25),math.rad(20)),.3)
  663. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*angles(math.rad(5),math.rad(25),math.rad(-20)),.3)
  664. RH.C0=clerp(RH.C0,RHC0,.3)
  665. LH.C0=clerp(LH.C0,LHC0,.3)
  666. --shotgun.Parent.C0=clerp(shotgun.Parent.C0,cf(0-.5*math.cos(sine/30),0,0-.5*math.cos(sine/30))*angles(math.rad(0+1*math.cos(sine/30)),math.rad(-30),math.rad(0-1*math.cos(sine/30))),.2)
  667. end
  668. elseif torvel>=22 and hitfloor~=nil then
  669. Anim="Run"
  670. change=1
  671. if attack==false then
  672. RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0+0.1*math.cos(sine/2.5))*angles(math.rad(20+1*math.cos(sine/2.5)),math.rad(0),math.rad(0)),.3)
  673. Neck.C0=clerp(Neck.C0,necko*euler(-0.2+0.075*math.cos(sine/2.5),0,0),.3)
  674. Neck.C1=clerp(Neck.C1,necko2*euler(0,0,0),.3)
  675. RW.C0=clerp(RW.C0,cf(1.5,0.5,0)*angles(math.rad(-40),math.rad(0),math.rad(24)),.3)
  676. LW.C0=clerp(LW.C0,cf(-1.5,0.5,0)*angles(math.rad(-40),math.rad(0),math.rad(-24)),.3)
  677. RH.C0=clerp(RH.C0,cf(1,-1-0.1*math.cos(sine/5),0-0.5*math.cos(sine/5))*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(0+70*math.cos(sine/5))),.3)
  678. LH.C0=clerp(LH.C0,cf(-1,-1+0.1*math.cos(sine/5),0+0.5*math.cos(sine/5))*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(0+70*math.cos(sine/5))),.3)
  679. --shotgun.Parent.C0=clerp(shotgun.Parent.C0,cf(0-.5*math.cos(sine/30),0,0-.5*math.cos(sine/30))*angles(math.rad(0+1*math.cos(sine/30)),math.rad(-60),math.rad(0-1*math.cos(sine/30))),.2)
  680. end
  681. ]]--
  682. end
  683. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement