Advertisement
lafur

Untitled

Mar 26th, 2020
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Converted with ttyyuu12345's model to script plugin v4
  2. function sandbox(var,func)
  3. local env = getfenv(func)
  4. local newenv = setmetatable({},{
  5. __index = function(self,k)
  6. if k=="script" then
  7. return var
  8. else
  9. return env[k]
  10. end
  11. end,
  12. })
  13. setfenv(func,newenv)
  14. return func
  15. end
  16. cors = {}
  17. mas = Instance.new("Model",game:GetService("Lighting"))
  18. Tool0 = Instance.new("Tool")
  19. MeshPart1 = Instance.new("MeshPart")
  20. Sound2 = Instance.new("Sound")
  21. Script3 = Instance.new("Script")
  22. LocalScript4 = Instance.new("LocalScript")
  23. RemoteFunction5 = Instance.new("RemoteFunction")
  24. Part6 = Instance.new("Part")
  25. WeldConstraint7 = Instance.new("WeldConstraint")
  26. Script8 = Instance.new("Script")
  27. LocalScript9 = Instance.new("LocalScript")
  28. RemoteFunction10 = Instance.new("RemoteFunction")
  29. Tool0.Name = "M16"
  30. Tool0.Parent = mas
  31. Tool0.CanBeDropped = false
  32. Tool0.Grip = CFrame.new(-1, -0.100000001, 0, 0, 0, -1, -1, 0, 0, 0, 1, 0)
  33. Tool0.GripForward = Vector3.new(1, -0, -0)
  34. Tool0.GripPos = Vector3.new(-1, -0.100000001, 0)
  35. Tool0.GripRight = Vector3.new(0, -1, 0)
  36. Tool0.GripUp = Vector3.new(0, 0, 1)
  37. MeshPart1.Name = "Handle"
  38. MeshPart1.Parent = Tool0
  39. MeshPart1.CFrame = CFrame.new(-19.7733021, 1.20430827, -770.653015, -4.37113883e-08, -1, 0, -4.37113883e-08, 1.91068547e-15, 1, -1, 4.37113883e-08, -4.37113883e-08)
  40. MeshPart1.Orientation = Vector3.new(-90, 90, 0)
  41. MeshPart1.Position = Vector3.new(-19.7733021, 1.20430827, -770.653015)
  42. MeshPart1.Rotation = Vector3.new(-90, 0, 90)
  43. MeshPart1.Size = Vector3.new(7.03528309, 0.635280371, 2.32869124)
  44. MeshPart1.CanCollide = false
  45. MeshPart1.TextureID = "rbxassetid://450215258"
  46. Sound2.Name = "M16 Shot [Free]"
  47. Sound2.Parent = MeshPart1
  48. Sound2.SoundId = "rbxassetid://151997297"
  49. Script3.Name = "Handler"
  50. Script3.Parent = Tool0
  51. table.insert(cors,sandbox(Script3,function()
  52. Player = script.Parent.Parent.Parent
  53. Character=Player.Character
  54. hitev = script.Hit
  55. local mouse=Player:GetMouse()
  56.  
  57. active = false
  58.  
  59. NLS([[
  60.  
  61. ]],Player)
  62.  
  63. function rayCast(Pos, Dir, Max, Ignore)
  64. local ig = workspace.ignoreFolder:GetChildren()
  65. table.insert(ig,0,script.Parent.Handle)
  66. table.insert(ig,0,script.Parent.FirePart)
  67. return game:service("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Pos, Dir.unit * (Max or 5000)), ig)
  68. end
  69. function nooutline(part)
  70. part.TopSurface,part.BottomSurface,part.LeftSurface,part.RightSurface,part.FrontSurface,part.BackSurface = 10,10,10,10,10,10
  71. end
  72.  
  73. function part(formfactor,parent,material,reflectance,transparency,brickcolor,name,size)
  74. local fp=Instance.new("Part")
  75. fp.formFactor=formfactor
  76. fp.Parent=parent
  77. fp.Reflectance=reflectance
  78. fp.Transparency=transparency
  79. fp.CanCollide=false
  80. fp.Locked=true
  81. fp.BrickColor=BrickColor.new(tostring(brickcolor))
  82. fp.Name=name
  83. fp.Size=size
  84. fp.Position=Player.Character.Torso.Position
  85. nooutline(fp)
  86. fp.Material=material
  87. fp:BreakJoints()
  88. return fp
  89. end
  90.  
  91. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  92. local mesh=Instance.new(Mesh)
  93. mesh.Parent=part
  94. if Mesh=="SpecialMesh" then
  95. mesh.MeshType=meshtype
  96. mesh.MeshId=meshid
  97. end
  98. mesh.Offset=offset
  99. mesh.Scale=scale
  100. return mesh
  101. end
  102.  
  103. function swait(num)
  104. if num==0 or num==nil then
  105. game:service'RunService'.Heartbeat:wait(0)
  106. else
  107. for i=0,num do
  108. game:service'RunService'.Heartbeat:wait(0)
  109. end
  110. end
  111. end
  112.  
  113. vt=Vector3.new
  114. cf=CFrame.new
  115. euler=CFrame.fromEulerAnglesXYZ
  116. angles=CFrame.Angles
  117.  
  118. function MagicCylinder(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  119. local prt=part(3,workspace.ignoreFolder,"Neon",0,0,brickcolor,"Effect",vt(0.2,0.2,0.2))
  120. prt.Anchored=true
  121. prt.CFrame=cframe
  122. local msh=mesh("SpecialMesh",prt,"Head","",vt(0,0,0),vt(x1,y1,z1))
  123. game:GetService("Debris"):AddItem(prt,2)
  124. coroutine.resume(coroutine.create(function(Part,Mesh)
  125. for i=0,1,delay do
  126. swait()
  127. Part.CFrame=Part.CFrame
  128. Part.Transparency=i
  129. Part.Scale=Part.Scale+vt(x3,y3,z3)
  130. end
  131. Part.Parent=nil
  132. end),prt,msh)
  133. end
  134.  
  135.  
  136. function MagicPart(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
  137. local prt=part(3,workspace.ignoreFolder,"Neon",0,0,brickcolor,"Effect",vt())
  138. prt.Anchored=true
  139. prt.CFrame=cframe
  140. local msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
  141. game:GetService("Debris"):AddItem(prt,2)
  142. coroutine.resume(coroutine.create(function(Part,Mesh)
  143. for i=0,1,delay do
  144. swait()
  145. Part.CFrame=Part.CFrame
  146. Part.Transparency=i
  147. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  148. end
  149. Part.Parent=nil
  150. end),prt,msh)
  151. end
  152.  
  153. attack = false
  154.  
  155. function Shoot(Prt,Parent)
  156. attack=true
  157. local sfx = script.Parent.Handle["M16 Shot [Free]"]:Clone()
  158. sfx.Parent=script.Parent
  159. sfx:Play()
  160. game:GetService("Debris"):AddItem(sfx,2)
  161. local efprt=part(3,workspace.ignoreFolder,"Neon",0,0.5,BrickColor.new("Bright green"),"Effect",vt(0.2,0.2,0.2))
  162. efprt.Anchored=true
  163. local efmsh=mesh("CylinderMesh",efprt,"","",vt(0,0,0),vt(1,1,1))
  164. local spread=vt((math.random(-1,0)+math.random())*2,(math.random(-1,0)+math.random())*2,(math.random(-1,0)+math.random())*2)*((Prt.Position-hitev:InvokeClient(Player).Position).magnitude/40)
  165. coroutine.resume(coroutine.create(function(Part,Mesh,Spreaded)
  166. game:GetService("Debris"):AddItem(Part,6)
  167. local TheHit=hitev:InvokeClient(Player).Position
  168. local MouseLook=cf((Prt.Position+TheHit)/2,TheHit+Spreaded/14)
  169. local hit,pos = rayCast(Prt.Position,MouseLook.lookVector,2000,Parent)
  170. local tefprt=part(3,workspace.ignoreFolder,"Neon",0,1,BrickColor.new("Black"),"Effect",vt(0.2,0.2,0.2))
  171. tefprt.CFrame=cf(pos)
  172. game:GetService("Debris"):AddItem(tefprt,3)
  173. Part.CFrame=CFrame.new((Prt.Position+pos)/2,pos)*angles(1.57,0,0)
  174. if(hit.Parent:FindFirstChild("Enemy")~= nil)then
  175. if hit.Parent:FindFirstChild("Enemy") ~= nil and hit.Name ~= "Base" and hit.Parent.Name ~= Player.Name then
  176. hit.Parent:FindFirstChild("Enemy"):TakeDamage(4)
  177. end
  178. end
  179. local mag=(Prt.Position-pos).magnitude
  180. MagicCylinder(BrickColor.new("Bright yellow"),Part.CFrame,1,mag*5,-0.5,-0.05,0,-0.5,0.05) --really yellow
  181. end),efprt,efmsh,spread)
  182. wait(0.05)
  183. attack = false
  184. end
  185.  
  186. function Shoot3(Prt,Parent)
  187. local MainPos=Prt.Position
  188. local TheHit=hitev:InvokeClient(Player).Position
  189. local MouseLook=cf((Prt.Position+TheHit)/2,TheHit)
  190. local hit,pos = rayCast(Prt.Position,MouseLook.lookVector,2000,Parent)
  191. local MainPos=MainPos+(MouseLook.lookVector*10)
  192. --[[
  193. local bullet2 = Instance.new("Part",workspace)
  194. local bodyVel = Instance.new("BodyVelocity",bullet2)
  195.  
  196. bullet2.Size = Vector3.new(0.5, 0.5, 22.5)
  197. bullet2.Position = script.Parent.Handle.Position
  198. bullet2.CFrame = CFrame.new(script.Parent.Handle.CFrame.p,hitev:InvokeClient(Player).Position)
  199.  
  200. bodyVel.Velocity = bullet2.CFrame.LookVector * 1000
  201. ]]--
  202. local bullet = game.ReplicatedStorage.Bullet:Clone()
  203. bullet.Parent = workspace.ignoreFolder
  204. bullet.Position = script.Parent.Handle.Position
  205. bullet.CFrame = CFrame.new(script.Parent.Handle.Position,hitev:InvokeClient(Player).Position)
  206. bullet.Ignore.Value = Player.Character
  207. game:GetService("Debris"):AddItem(bullet,10)
  208. end
  209.  
  210.  
  211. script.Parent.Deactivated:Connect(function()
  212. active = false
  213. end)
  214. script.Parent.Equipped:Connect(function()
  215. local trck = Player.Character.Humanoid:LoadAnimation(game.ServerStorage.Equip16:Clone())
  216. trck:Play()
  217. wait(1.5)
  218. local trck0 = Player.Character.Humanoid:LoadAnimation(Player.Character.Idle)
  219. trck0:Play()
  220. trck0:GetMarkerReachedSignal("End"):Connect(function()
  221. print('A')
  222. trck0:Play()
  223. end)
  224. end)
  225.  
  226. script.Parent.Activated:Connect(function()
  227. if not attack then
  228. active = true
  229. repeat
  230. Shoot3(script.Parent.FirePart)
  231. until not active
  232. end
  233. end)
  234. end))
  235. Script3.Disabled = true
  236. LocalScript4.Name = "Local"
  237. LocalScript4.Parent = Script3
  238. table.insert(cors,sandbox(LocalScript4,function()
  239. q = script.Parent:WaitForChild("Hit")
  240. plr = script.Parent.Parent.Parent.Parent
  241.  
  242.  
  243. q.OnClientInvoke = function()
  244. return plr:GetMouse().Hit
  245. end
  246. end))
  247. RemoteFunction5.Name = "Hit"
  248. RemoteFunction5.Parent = Script3
  249. Part6.Name = "FirePart"
  250. Part6.Parent = Tool0
  251. Part6.CFrame = CFrame.new(-16.3010826, 1.72269416, -770.552185, 1, 0, -1.85062657e-16, 0, 1, 0, -1.85062657e-16, 0, 1)
  252. Part6.Position = Vector3.new(-16.3010826, 1.72269416, -770.552185)
  253. Part6.Color = Color3.new(0.105882, 0.164706, 0.207843)
  254. Part6.Size = Vector3.new(0.0522434749, 0.10971082, 0.0888137147)
  255. Part6.BottomSurface = Enum.SurfaceType.Smooth
  256. Part6.BrickColor = BrickColor.new("Black")
  257. Part6.CanCollide = false
  258. Part6.Material = Enum.Material.SmoothPlastic
  259. Part6.TopSurface = Enum.SurfaceType.Smooth
  260. Part6.brickColor = BrickColor.new("Black")
  261. WeldConstraint7.Parent = Part6
  262. WeldConstraint7.Part0 = Part6
  263. WeldConstraint7.Part1 = MeshPart1
  264. Script8.Name = "Handler"
  265. Script8.Parent = Tool0
  266. table.insert(cors,sandbox(Script8,function()
  267. Player = script.Parent.Parent.Parent
  268. Character=Player.Character
  269. hitev = script.Hit
  270. local mouse=Player:GetMouse()
  271.  
  272. wait(2)
  273.  
  274. hum = Player.Character:WaitForChild("Humanoid")
  275.  
  276. trck0 = hum:LoadAnimation(Player.Character.Idle0)
  277.  
  278. trck = hum:LoadAnimation(game.ServerStorage.Equip16:Clone())
  279.  
  280. active = false
  281.  
  282. function Shoot3(Prt,Parent)
  283. local bullet = game.ReplicatedStorage.Bullet:Clone()
  284. bullet.Position = script.Parent.Handle.Position
  285. bullet.CFrame = CFrame.new(script.Parent.Handle.Position,hitev:InvokeClient(Player).Position) * CFrame.new(0,0,-4)
  286. bullet.Ignore.Value = Player.Character
  287. bullet.Parent = workspace.ignoreFolder
  288. game:GetService("Debris"):AddItem(bullet,5)
  289. end
  290.  
  291. script.Parent.Deactivated:Connect(function()
  292. active = false
  293. end)
  294.  
  295. script.Parent.Equipped:Connect(function()
  296. trck:Play()
  297. wait(1.5)
  298. trck0:Play()
  299. end)
  300.  
  301. script.Parent.Unequipped:Connect(function()
  302. trck0:Stop()
  303. end)
  304.  
  305. script.Parent.Activated:Connect(function()
  306. active = true
  307. while active do
  308. Shoot3(script.Parent.FirePart)
  309. wait(0.05)
  310. end
  311. end)
  312. end))
  313. LocalScript9.Name = "Local"
  314. LocalScript9.Parent = Script8
  315. table.insert(cors,sandbox(LocalScript9,function()
  316. q = script.Parent:WaitForChild("Hit")
  317. plr = script.Parent.Parent.Parent.Parent
  318.  
  319.  
  320. q.OnClientInvoke = function()
  321. return plr:GetMouse().Hit
  322. end
  323. end))
  324. RemoteFunction10.Name = "Hit"
  325. RemoteFunction10.Parent = Script8
  326. for i,v in pairs(mas:GetChildren()) do
  327. v.Parent = game.Players.lafur2.Backpack
  328. pcall(function() v:MakeJoints() end)
  329. end
  330. mas:Destroy()
  331. for i,v in pairs(cors) do
  332. spawn(function()
  333. pcall(v)
  334. end)
  335. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement