Sewab

Untitled

Oct 31st, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 52.57 KB | None | 0 0
  1. part.Touched:connect(function(hit)
  2. if slap == true then
  3. if cd == false then
  4. if not hit:IsDescendantOf(plr.Character) then
  5. if hit.Parent:IsA("Model") then
  6. local fhum = firstHum(hit.Parent)
  7. if fhum then
  8. cd = true
  9. fhum.PlatformStand = true
  10. sound:Play()
  11. local con1
  12. con1 = game:GetService("RunService").Heartbeat:connect(function()
  13. fhum.PlatformStand = true
  14. end)
  15. wait(0.1)
  16. local vel = Instance.new("BodyVelocity",hit)
  17. vel.Velocity = ((hit.Position - plr.Character:WaitForChild("HumanoidRootPart").Position).unit + Vector3.new(0,0.5,0))*50
  18. vel.MaxForce = Vector3.new(10000000,10000000,10000000)
  19. wait(1)
  20. cd = false
  21. vel:Destroy()
  22. local vel2 = Instance.new("BodyVelocity",hit)
  23. vel2.Velocity = Vector3.new(0,12.5,0)
  24. vel2.MaxForce = Vector3.new(10000000,10000000,10000000)
  25. local p2 = Instance.new("Part",hit)
  26. p2.Anchored = true
  27. p2.Transparency = 0.6
  28. p2.CanCollide = false
  29. p2.Size = Vector3.new(0.2,0.2,0.2)
  30. p2.CFrame = CFrame.new(hit.CFrame.p) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))
  31. p2.BrickColor = BrickColor.new("New Yeller")
  32. p2.Material = "Neon"
  33. local m2 = Instance.new("CylinderMesh",p2)
  34. m2.Scale = Vector3.new(60,10000,60)
  35. local scln = sound3:Clone()
  36. scln.Parent = hit
  37. scln:Play()
  38. local con2
  39. con2 = game:GetService("RunService").Heartbeat:connect(function()
  40. p2.CFrame = CFrame.new(hit.CFrame.p) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))
  41. end)
  42. wait(7)
  43. vel2.Velocity = Vector3.new(0,0,0)
  44. wait(0.5)
  45. scln:Stop()
  46. local scln3 = sound5:Clone()
  47. scln3.Parent = hit
  48. scln3:Play()
  49. wait(1)
  50. local bav = Instance.new("BodyAngularVelocity",hit)
  51. bav.AngularVelocity = Vector3.new(math.random(0,360),math.random(0,360),math.random(0,360))
  52. vel2.Velocity = Vector3.new(0,-250,0)
  53. p2.BrickColor = BrickColor.new("Really red")
  54. local scln6 = sound6:Clone()
  55. scln6.Parent = hit
  56. scln6:Play()
  57. local continue = false
  58. local htc
  59. htc = hit.Touched:connect(function(hitp)
  60. if not hitp:IsDescendantOf(hit.Parent) then
  61. continue = true
  62. scln6:Stop()
  63. vel2:Destroy()
  64. con2:Disconnect()
  65. con1:Disconnect()
  66. htc:Disconnect()
  67. p2:Destroy()
  68. end
  69. end)
  70. repeat wait() until continue == true
  71. local ctab = {}
  72. for i=1,4 do
  73. local p = Instance.new("Part",hit)
  74. p.Size = Vector3.new(30,30,30)
  75. p.Anchored = true
  76. p.CanCollide = false
  77. p.TopSurface = "Smooth"
  78. p.BottomSurface = "Smooth"
  79. p.Color = Color3.fromRGB(255,math.random(0,255),0)
  80. p.CFrame = hit.CFrame
  81. local con
  82. con = game:GetService("RunService").Heartbeat:connect(function()
  83. p.CFrame = p.CFrame * CFrame.Angles(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360)))
  84. p.Transparency = p.Transparency + 0.01
  85. if p.Transparency >= 1 then
  86. con:Disconnect()
  87. end
  88. end)
  89. table.insert(ctab,con)
  90. end
  91. Instance.new("Explosion",workspace).Position = hit.Position
  92. local scln2 = sound4:Clone()
  93. scln2.Parent = hit
  94. scln2:Play()
  95. vel2:Destroy()
  96. hit.Parent:BreakJoints()
  97. repeat wait() until not hit:IsDescendantOf(workspace)
  98. con2:Disconnect()
  99. end
  100. end
  101. end
  102. end
  103. end
  104. end)
  105. --Go to line 216 to put id of song
  106. o1 = Instance.new("Model")
  107. o1.Name = "Vest"
  108. o2 = Instance.new("Part")
  109. o2.Name = "Middle"
  110. o2.Parent = o1
  111. o2.BrickColor = BrickColor.new("Brick yellow")
  112. o2.Transparency = 1
  113. o2.Position = Vector3.new(0.139906004, 1.05800402, -11.1099901)
  114. o2.Anchored = true
  115. o2.CFrame = CFrame.new(0.139906004, 1.05800402, -11.1099901, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  116. o2.CanCollide = false
  117. o2.FormFactor = Enum.FormFactor.Symmetric
  118. o2.Size = Vector3.new(2, 2, 1)
  119. o2.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  120. o2.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  121. o2.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  122. o2.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  123. o2.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  124. o2.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  125. o2.Color = Color3.new(0.843137, 0.772549, 0.603922)
  126. o3 = Instance.new("Part")
  127. o3.Name = "Pack"
  128. o3.Parent = o1
  129. o3.BrickColor = BrickColor.new("Dark stone grey")
  130. o3.Position = Vector3.new(0.139907002, 1.07000601, -10.3049936)
  131. o3.Rotation = Vector3.new(-180, 0, -180)
  132. o3.Anchored = true
  133. o3.CFrame = CFrame.new(0.139907002, 1.07000601, -10.3049936, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  134. o3.CanCollide = false
  135. o3.FormFactor = Enum.FormFactor.Custom
  136. o3.Size = Vector3.new(1.65999985, 1.80000019, 0.630000472)
  137. o3.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  138. o3.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  139. o3.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  140. o3.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  141. o3.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  142. o3.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  143. o3.Color = Color3.new(0.388235, 0.372549, 0.384314)
  144. o4 = Instance.new("Part")
  145. o4.Name = "Strap"
  146. o4.Parent = o1
  147. o4.BrickColor = BrickColor.new("Black")
  148. o4.Position = Vector3.new(0.66991502, 1.05500698, -11.1149797)
  149. o4.Anchored = true
  150. o4.CFrame = CFrame.new(0.66991502, 1.05500698, -11.1149797, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  151. o4.CanCollide = false
  152. o4.FormFactor = Enum.FormFactor.Custom
  153. o4.Size = Vector3.new(0.259999752, 2.11000037, 1.15000045)
  154. o4.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  155. o4.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  156. o4.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  157. o4.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  158. o4.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  159. o4.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  160. o4.Color = Color3.new(0.105882, 0.164706, 0.207843)
  161. o5 = Instance.new("Part")
  162. o5.Name = "Flap"
  163. o5.Parent = o1
  164. o5.BrickColor = BrickColor.new("Black")
  165. o5.Position = Vector3.new(0.139905006, 1.85000098, -10.2900219)
  166. o5.Anchored = true
  167. o5.CFrame = CFrame.new(0.139905006, 1.85000098, -10.2900219, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  168. o5.CanCollide = false
  169. o5.FormFactor = Enum.FormFactor.Custom
  170. o5.Size = Vector3.new(1.71999979, 0.400000006, 0.639999866)
  171. o5.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  172. o5.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  173. o5.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  174. o5.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  175. o5.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  176. o5.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  177. o5.Color = Color3.new(0.105882, 0.164706, 0.207843)
  178. o6 = Instance.new("Part")
  179. o6.Name = "Pocket"
  180. o6.Parent = o1
  181. o6.BrickColor = BrickColor.new("Black")
  182. o6.Position = Vector3.new(0.149883002, 0.860005975, -10.0399857)
  183. o6.Rotation = Vector3.new(-0, 0, -90)
  184. o6.Anchored = true
  185. o6.CFrame = CFrame.new(0.149883002, 0.860005975, -10.0399857, 0, 1, 0, -1, 0, 0, 0, 0, 1)
  186. o6.CanCollide = false
  187. o6.FormFactor = Enum.FormFactor.Custom
  188. o6.Size = Vector3.new(0.600000024, 0.800000131, 0.200000003)
  189. o6.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  190. o6.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  191. o6.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  192. o6.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  193. o6.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  194. o6.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  195. o6.Color = Color3.new(0.105882, 0.164706, 0.207843)
  196. o7 = Instance.new("Part")
  197. o7.Name = "Pocket"
  198. o7.Parent = o1
  199. o7.BrickColor = BrickColor.new("Black")
  200. o7.Position = Vector3.new(0.139600992, 1.10000801, -10.3099718)
  201. o7.Rotation = Vector3.new(-90, 90, 0)
  202. o7.Anchored = true
  203. o7.CFrame = CFrame.new(0.139600992, 1.10000801, -10.3099718, 0, 0, 1, -1, 0, 0, 0, -1, 0)
  204. o7.CanCollide = false
  205. o7.FormFactor = Enum.FormFactor.Custom
  206. o7.Size = Vector3.new(0.600000024, 0.400000155, 1.70000005)
  207. o7.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  208. o7.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  209. o7.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  210. o7.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  211. o7.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  212. o7.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  213. o7.Color = Color3.new(0.105882, 0.164706, 0.207843)
  214. o8 = Instance.new("Part")
  215. o8.Name = "Strap"
  216. o8.Parent = o1
  217. o8.BrickColor = BrickColor.new("Black")
  218. o8.Position = Vector3.new(-0.37014699, 1.05500698, -11.1149921)
  219. o8.Anchored = true
  220. o8.CFrame = CFrame.new(-0.37014699, 1.05500698, -11.1149921, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  221. o8.CanCollide = false
  222. o8.FormFactor = Enum.FormFactor.Custom
  223. o8.Size = Vector3.new(0.259999752, 2.11000037, 1.15000045)
  224. o8.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  225. o8.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  226. o8.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  227. o8.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  228. o8.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  229. o8.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  230. o8.Color = Color3.new(0.105882, 0.164706, 0.207843)
  231. o9 = Instance.new("Part")
  232. o9.Parent = o1
  233. o9.BrickColor = BrickColor.new("Really black")
  234. o9.Reflectance = 0.10000000149012
  235. o9.Position = Vector3.new(0.173590899, 4.00173569, -9.98207664)
  236. o9.Rotation = Vector3.new(2.9181666e-009, -3.48279983e-008, -8.55249798e-019)
  237. o9.Anchored = true
  238. o9.CFrame = CFrame.new(0.173590899, 4.00173569, -9.98207664, 0.999998331, 1.49269007e-020, -6.07863204e-010, 1.49269007e-020, 1, -5.09317831e-011, -6.07863204e-010, -5.09317831e-011, 1.00000334)
  239. o9.FormFactor = Enum.FormFactor.Plate
  240. o9.Size = Vector3.new(2, 4.80000019, 2)
  241. o9.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  242. o9.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  243. o9.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  244. o9.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  245. o9.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  246. o9.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  247. o9.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  248. o10 = Instance.new("SpecialMesh")
  249. o10.Parent = o9
  250. o10.Scale = Vector3.new(0.600000024, 1, 0.600000024)
  251. o10.MeshType = Enum.MeshType.Brick
  252. o11 = Instance.new("Part")
  253. o11.Parent = o1
  254. o11.BrickColor = BrickColor.new("Mid gray")
  255. o11.Reflectance = 0.20000000298023
  256. o11.Position = Vector3.new(0.173592806, 4.10173273, -11.1821489)
  257. o11.Rotation = Vector3.new(-180, 89.8953247, -90)
  258. o11.Anchored = true
  259. o11.CFrame = CFrame.new(0.173592806, 4.10173273, -11.1821489, -1.49269007e-020, 6.07863204e-010, 0.999998331, -1, 5.09317831e-011, 1.49269007e-020, 5.09317831e-011, -1.00000334, -6.07863204e-010)
  260. o11.FormFactor = Enum.FormFactor.Plate
  261. o11.Size = Vector3.new(1, 0.400000006, 2)
  262. o11.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  263. o11.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  264. o11.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  265. o11.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  266. o11.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  267. o11.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  268. o11.Color = Color3.new(0.803922, 0.803922, 0.803922)
  269. o12 = Instance.new("CylinderMesh")
  270. o12.Parent = o11
  271. o12.Offset = Vector3.new(0, -0.600000024, 0)
  272. o12.Scale = Vector3.new(0.5, 0.100000001, 0.5)
  273. o13 = Instance.new("Part")
  274. o13.Parent = o1
  275. o13.BrickColor = BrickColor.new("Mid gray")
  276. o13.Reflectance = 0.20000000298023
  277. o13.Position = Vector3.new(0.173592806, 5.60169125, -11.1821489)
  278. o13.Rotation = Vector3.new(1.40697509e-009, -89.8953247, -90)
  279. o13.Anchored = true
  280. o13.CFrame = CFrame.new(0.173592806, 5.60169125, -11.1821489, 1.49269007e-020, 6.07863204e-010, -0.999998331, 1, 5.09317831e-011, -1.49269007e-020, -5.09317831e-011, -1.00000334, 6.07863204e-010)
  281. o13.FormFactor = Enum.FormFactor.Plate
  282. o13.Size = Vector3.new(2, 0.400000006, 2)
  283. o13.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  284. o13.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  285. o13.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  286. o13.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  287. o13.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  288. o13.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  289. o13.Color = Color3.new(0.803922, 0.803922, 0.803922)
  290. o14 = Instance.new("CylinderMesh")
  291. o14.Parent = o13
  292. o14.Offset = Vector3.new(0, -0.600000024, 0)
  293. o14.Scale = Vector3.new(0.5, 0.100000001, 0.5)
  294. o15 = Instance.new("Part")
  295. o15.Parent = o1
  296. o15.BrickColor = BrickColor.new("Mid gray")
  297. o15.Reflectance = 0.20000000298023
  298. o15.Position = Vector3.new(0.173592806, 2.60173273, -11.1821489)
  299. o15.Rotation = Vector3.new(-180, 89.8953247, -90)
  300. o15.Anchored = true
  301. o15.CFrame = CFrame.new(0.173592806, 2.60173273, -11.1821489, -1.49269007e-020, 6.07863204e-010, 0.999998331, -1, 5.09317831e-011, 1.49269007e-020, 5.09317831e-011, -1.00000334, -6.07863204e-010)
  302. o15.FormFactor = Enum.FormFactor.Plate
  303. o15.Size = Vector3.new(2, 0.400000006, 2)
  304. o15.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  305. o15.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  306. o15.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  307. o15.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  308. o15.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  309. o15.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  310. o15.Color = Color3.new(0.803922, 0.803922, 0.803922)
  311. o16 = Instance.new("CylinderMesh")
  312. o16.Parent = o15
  313. o16.Offset = Vector3.new(0, -0.600000024, 0)
  314. o16.Scale = Vector3.new(0.5, 0.100000001, 0.5)
  315. myears = Instance.new('Sound')
  316. myears.Parent = game.Players.LocalPlayer.Character.Head
  317. myears.Looped = true
  318. myears.Name = "Ruski"
  319. myears.Playing = true
  320. myears.SoundId = "rbxassetid://318539584"
  321. myears.Volume = .5
  322. myears.TimePosition = 0
  323. local g = o1:clone()
  324. g.Parent = game.Players.LocalPlayer.Character
  325. local C = g:GetChildren()
  326. for i=1, #C do
  327. if C[i].className == "Part" then
  328. local W = Instance.new("Weld")
  329. W.Part0 = g.Middle
  330. W.Part1 = C[i]
  331. local CJ = CFrame.new(g.Middle.Position)
  332. local C0 = g.Middle.CFrame:inverse()*CJ
  333. local C1 = C[i].CFrame:inverse()*CJ
  334. W.C0 = C0
  335. W.C1 = C1
  336. W.Parent = g.Middle
  337. end
  338. local Y = Instance.new("Weld")
  339. Y.Part0 = game.Players.LocalPlayer.Character.Torso
  340. Y.Part1 = g.Middle
  341. Y.C0 = CFrame.new(0, 0, 0)
  342. Y.Parent = Y.Part0
  343. end
  344.  
  345. local h = g:GetChildren()
  346. for i = 1, # h do
  347. h[i].Anchored = false
  348. h[i].CanCollide = false
  349. end
  350. --[[
  351. Smith and Wesson M&P 45, chambered in .45 ACP ammunition.
  352. The standard magazine holds 10 rounds, although magazines that could hold 14 rounds were also made but looked incredibly stupid.
  353. Credit to litozinnamon for the crosshairs and bullethole decals. I used them without permission. Not like I asked him, anyhow.
  354. ]]
  355.  
  356. plr=game:service'Players'.LocalPlayer
  357. ch,char=plr.Character,plr.Character
  358. hum=ch.Humanoid
  359. tor,torso,rootpart,rj=ch.Torso,ch.Torso,ch.HumanoidRootPart,ch.HumanoidRootPart.RootJoint
  360. m,mouse=plr:GetMouse(),plr:GetMouse()
  361. cfn,ang,mr,int=CFrame.new,CFrame.Angles,math.rad,Instance.new
  362. bc=BrickColor.new
  363. head=ch.Head
  364. cam=workspace.CurrentCamera
  365.  
  366. rj.C0=cfn()
  367. rj.C1=cfn()
  368.  
  369. sheathed=false
  370. jammed=false
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382. local minimumsize = Vector3.new(0.7,0.7,0.7) --Minimumsize for a part to get divided,higher numbers = less detailed and bigger/less bricks
  383. local surface_between_splitted_parts = 'SmoothNoOutlines' --the surface between splitted parts
  384. --local fragmented = workspace:FindFirstChild("Fragmented")
  385. local fragmentable = workspace --all fragmentable objects should be stored in here
  386. local list = {}
  387. local brickcount = 0
  388. --local m = Instance.new("Hint",workspace)
  389. local storage = {}
  390. local fillup = 1000 --it constantly generates new parts until it reaches this number(hacky way to prevent lagspikes if there is a large explosion),change it to 0 if you don´t want it to generate (useless) parts.
  391. local maximumstorage = 2000 --it will recycle parts if the number of parts in the storage doesnt exceed this number
  392. local storage_position = Vector3.new(0,0,5000) --place them somewhere off the map
  393. local stored_partsize = Vector3.new(1,1,1) --make them small
  394. local parts_created_per_frame = 5 --number of parts being created per frame to fill up the storage
  395.  
  396.  
  397. function fragmentate(cframe,size,color,explosion_position,explosion_blastradius,backsurface,bottomsurface,frontsurface,leftsurface,rightsurface,topsurface,transparency,reflectance)
  398. local xi = size.X >= minimumsize.X*(1+explosion_blastradius/16) and 2 or 1 --to reduce the lagg in large explosions we increase minimumsize based on the explosionradius...
  399. local yi = size.Y >= minimumsize.Y*(1+explosion_blastradius/16) and 2 or 1
  400. local zi = size.Z >= minimumsize.Z*(1+explosion_blastradius/16) and 2 or 1
  401. if xi == 1 and yi == 1 and zi == 1 or (cframe.p-explosion_position).magnitude > size.magnitude/2 + explosion_blastradius then --don´t fragmentate parts, that are too small to fragmentate or too far away from the explosion
  402. if xi == 1 and yi == 1 and zi == 1 then return end --optional
  403. if #storage > 0 then
  404. local p = storage[1]
  405. p.BrickColor = color
  406. p.Size = size
  407. p.BackSurface = backsurface
  408. p.BottomSurface = bottomsurface
  409. p.FrontSurface = frontsurface
  410. p.LeftSurface = leftsurface
  411. p.RightSurface = rightsurface
  412. p.TopSurface = topsurface
  413. p.Transparency = transparency
  414. p.CFrame = cframe
  415. p.Reflectance = reflectance
  416. table.remove(storage,1)
  417. else
  418. local p = Instance.new("Part",fragmentable)
  419. p.BrickColor = color
  420. p.FormFactor = "Custom"
  421. p.Size = size
  422. p.BackSurface = backsurface
  423. p.BottomSurface = bottomsurface
  424. p.FrontSurface = frontsurface
  425. p.LeftSurface = leftsurface
  426. p.RightSurface = rightsurface
  427. p.TopSurface = topsurface
  428. p.Transparency = transparency
  429. if p.Transparency>0.285 then
  430. p.Anchored = false
  431. else
  432. p.Anchored=true
  433. p.Material='Wood'
  434. end
  435. p.CFrame = cframe
  436. p.Reflectance = reflectance
  437. end
  438. --p:MakeJoints()
  439. -- m.Text = m.Text+1
  440. return --stop the function
  441. end
  442. local mody = math.random(-125,125)/1000 --some randomization
  443. for y = 1,yi do
  444. if math.random()> 0.5 then
  445. local modx = math.random(-125,125)/1000
  446. for x = 1,xi do
  447. local modz = math.random(-125,125)/1000
  448. for z = 1,zi do --offset = x/xi-0.75+modx)
  449. fragmentate(cframe*CFrame.new(size.X*(xi==1 and 0 or x/xi-0.75+modx),size.Y*(yi==1 and 0 or y/yi-0.75+mody),size.Z*(zi==1 and 0 or z/zi-0.75+modz)), --maths
  450. Vector3.new(xi == 2 and size.X*(1-2*math.abs(x/xi-0.75+modx)) or size.X,yi == 2 and size.Y*(1-2*math.abs(y/yi-0.75+mody)) or size.Y,
  451. zi == 2 and size.Z*(1-2*math.abs(z/zi-0.75+modz)) or size.Z or agent767_was_here),color,explosion_position,explosion_blastradius,
  452. z~=zi and surface_between_splitted_parts or backsurface,y==2 and surface_between_splitted_parts or bottomsurface,
  453. z==2 and surface_between_splitted_parts or frontsurface,x==2 and surface_between_splitted_parts or leftsurface,x~=xi and surface_between_splitted_parts or rightsurface,
  454. y~=yi and surface_between_splitted_parts or topsurface,transparency,reflectance)
  455. end
  456.  
  457. end
  458. else
  459. local modz = math.random(-125,125)/1000
  460. for z = 1,zi do
  461. local modx = math.random(-125,125)/1000
  462. for x = 1,xi do
  463. fragmentate(cframe*CFrame.new(size.X*(xi==1 and 0 or x/xi-0.75+modx),size.Y*(yi==1 and 0 or y/yi-0.75+mody),size.Z*(zi==1 and 0 or z/zi-0.75+modz)),
  464. Vector3.new(xi == 2 and size.X*(1-2*math.abs(x/xi-0.75+modx)) or size.X,yi == 2 and size.Y*(1-2*math.abs(y/yi-0.75+mody)) or size.Y,
  465. zi == 2 and size.Z*(1-2*math.abs(z/zi-0.75+modz)) or size.Z),color,explosion_position,explosion_blastradius,
  466. z~=zi and surface_between_splitted_parts or backsurface,y==2 and surface_between_splitted_parts or bottomsurface,
  467. z==2 and surface_between_splitted_parts or frontsurface,x==2 and surface_between_splitted_parts or leftsurface,x~=xi and surface_between_splitted_parts or rightsurface,
  468. y~=yi and surface_between_splitted_parts or topsurface,transparency,reflectance)
  469. end
  470. end
  471. end
  472. end
  473. end
  474.  
  475. function start_fragmentation(position,radius)
  476. local search = Region3.new(position-Vector3.new(radius,radius,radius)*1.1,position+Vector3.new(radius,radius,radius)*1.1)
  477. repeat
  478. local finish = false
  479. local parts = workspace:FindPartsInRegion3WithIgnoreList(search,list,100) --maximum number of parts that FindPartsInRegion3 can find is 100, so we have to do this to find them all
  480. for i = 1,#parts do
  481. table.insert(list,1,parts[i])
  482. end
  483. finish = true
  484. until #parts < 100 and finish
  485. print(#list)
  486. local t = tick()
  487. for i = 1,#list do
  488. local p = list[i]
  489. if p:IsDescendantOf(fragmentable) and p:GetMass()<3000 and p.Transparency>0.285 and p.Name~='Base' and p:IsDescendantOf(ch)==false then
  490. fragmentate(p.CFrame,p.Size,p.BrickColor,position,radius,p.BackSurface,p.BottomSurface,p.FrontSurface,p.LeftSurface,p.RightSurface,p.TopSurface,p.Transparency,p.Reflectance)
  491. if #storage < maximumstorage and p.Shape == "Block" then --recycle them
  492. p.Anchored = false
  493. p.FormFactor = "Custom"
  494. p.Size = stored_partsize
  495. p.Position = storage_position
  496. table.insert(storage,1,p)
  497. else --storage is full
  498. p:Destroy()
  499. end
  500. -- m.Text = m.Text-1
  501. end
  502. if p:IsDescendantOf(fragmentable) and p:GetMass()<53000 and p.Transparency<0.05 and p.Name~='Base' and tostring(p.Material)=='Enum.Material.Wood' and p:IsDescendantOf(ch)==false then
  503. fragmentate(p.CFrame,p.Size,p.BrickColor,position,radius,p.BackSurface,p.BottomSurface,p.FrontSurface,p.LeftSurface,p.RightSurface,p.TopSurface,p.Transparency,p.Reflectance)
  504. if #storage < maximumstorage and p.Shape == "Block" then --recycle them
  505. p.Anchored = true
  506. p.Material='Wood'
  507. p.FormFactor = "Custom"
  508. p.Size = stored_partsize
  509. p.Position = storage_position
  510. table.insert(storage,1,p)
  511. else --storage is full
  512. p:Destroy()
  513. end
  514. -- m.Text = m.Text-1
  515. end
  516. end
  517. list = {}
  518. -- print(tick()-t)
  519. end
  520.  
  521. --[[
  522. spawn(function()
  523. while wait() do --oh noes,a loop! So inefficient!
  524. if #storage < fillup then
  525. for i = 1, parts_created_per_frame do --creates parts to fill up the storage
  526. local p = Instance.new("Part",fragmentable)
  527. p.Anchored = false
  528. p.FormFactor = "Custom"
  529. p.Size = stored_partsize
  530. p.Position = storage_position
  531. table.insert(storage,1,p)
  532. end
  533. end
  534. end
  535. end)
  536. ]]
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560. --local blankn=22416261
  561.  
  562. --172121567
  563.  
  564. crosshairs={
  565. {38140824};
  566. {38140833};
  567. {38140839};
  568. {38140843};
  569. {38140852};
  570. {38140910};
  571. {38140915};
  572. {38140923};
  573. {38140928};
  574. {38140931};
  575. {38208259};
  576. {38208275};
  577. {38208284};
  578. {38208303};
  579. {38208310};
  580. {38208325};
  581. {38208330};
  582. {38208352};
  583. {38208359};
  584. {38208377}
  585. }
  586.  
  587. bulletholes={
  588. 172274695;
  589. 172274721
  590. }
  591.  
  592. for _,v in pairs(crosshairs) do
  593. game:service'ContentProvider':Preload('rbxassetid://' .. tostring(v[1]-1))
  594. end
  595.  
  596. currentIco=2
  597. switchIco=function(num)
  598. if num<20 then
  599. else
  600. num=20
  601. end
  602. mouse.Icon='rbxassetid://' .. tostring(crosshairs[num][1]-1)
  603. currentIco=num
  604. end
  605.  
  606. switchIco(currentIco)
  607.  
  608. heldDown=false
  609.  
  610. spreadint=1
  611. --[[Settings]]--
  612. recoil=false -- Set to true for added realism
  613. magCapacity=20 -- How much a magazine can hold at once
  614. magAmmo=20 -- How much ammo is in the mag
  615. crosshairSpread=5
  616. spread=1
  617. pAmmunition=true -- more damage if true
  618.  
  619.  
  620. jamRate=500 -- How often the gun jams(the more the less) (no less than 1)
  621.  
  622. primaryColor='Really black'
  623. secondaryColor='Really black'
  624.  
  625. slideReflectance=0.01
  626. slideMaterial='Plastic'
  627.  
  628. --[[Attachments]]--
  629.  
  630. silencer=true
  631. highCapMag=false -- High capacity magazine
  632. laser=true
  633. automatic=false
  634. grip=true
  635.  
  636.  
  637. getSound=function(id)
  638. game:service'ContentProvider':Preload('rbxassetid'..tostring(id))
  639. local s=int("Sound",ch.Head)
  640. s.SoundId='rbxassetid://' .. tostring(id)
  641. s.Volume=1
  642. return s
  643. end
  644.  
  645. local fireSound=getSound(151997297--[[10209842]])
  646. fireSound.Pitch=1.3
  647. --1.8
  648.  
  649. local releaseSound=getSound(10209813)
  650. releaseSound.Pitch=4
  651.  
  652. local reloadSound=getSound(10209636)
  653. reloadSound.Pitch=3
  654.  
  655. local magazinelockSound=getSound(152206337)
  656. magazinelockSound.Pitch=1.4
  657.  
  658. local slideBackSound=getSound(152206263)
  659. slideBackSound.Pitch=2.5
  660.  
  661. local slideForwardSound=getSound(152206302)
  662. slideForwardSound.Pitch=2.5
  663.  
  664. local emptySound=getSound(2697295)
  665. emptySound.Pitch=5
  666.  
  667. local glassBreakSound=getSound(144884907)
  668.  
  669. local woodImpact=getSound(142082171)
  670.  
  671. local fleshImpact=getSound(144884872)
  672. fleshImpact.Pitch=1.7
  673.  
  674. if ch:findFirstChild("Tec-99") then
  675. ch['Tec-99']:Destroy()
  676. end
  677.  
  678. local tube=int("Model",ch)
  679. tube.Name='Tec-99'
  680. local hopper=Instance.new('HopperBin',plr.Backpack)
  681. hopper.Name=tube.Name
  682. Weld = function(p0,p1,x,y,z,rx,ry,rz,par)--recommend to use this with my weld. use this function only with arm lockers.
  683. p0.Position = p1.Position
  684. local w = Instance.new('Motor',par or p0)
  685. w.Part0 = p1
  686. w.Part1 = p0
  687. w.C0 = CFrame.new(x or 0,y or 0,z or 0)*CFrame.Angles(rx or 0,ry or 0,rz or 0)
  688. w.MaxVelocity = .1
  689. return w
  690. end
  691. function clerp(c1,c2,sp)
  692. local R1,R2,R3 = c1:toEulerAnglesXYZ()
  693. local R21,R22,R23 = c2:toEulerAnglesXYZ()
  694. return CFrame.new(
  695. c1.X + (c2.X-c1.X)*sp,
  696. c1.Y + (c2.Y-c1.Y)*sp,
  697. c1.Z + (c2.Z-c1.Z)*sp)*CFrame.Angles(
  698. R1 + (R21-R1)*sp,
  699. R2 + (R22-R2)*sp,
  700. R3 + (R23-R3)*sp
  701. )
  702. end
  703.  
  704. tweenTable={}
  705. Tween = function(Weld, Stop, Step,a)
  706. ypcall(function()
  707. local func = function()
  708. local Start = Weld.C1
  709. local X1, Y1, Z1 = Start:toEulerAnglesXYZ()
  710. local Stop = Stop
  711. local X2, Y2, Z2 = Stop:toEulerAnglesXYZ()
  712. if not Step then Step=0.1 end
  713. table.insert(tweenTable,{th=0,Weld=Weld,Step=Step,Start=Start,X1=X1,Y1=Y1,Z1=Z1,Stop=Stop,X2=X2,Y2=Y2,Z2=Z2})
  714. end
  715. if a then coroutine.wrap(func)() else func() end
  716. end)
  717. end
  718. weld=function(p0,p1,c0)
  719. local w=Instance.new("Weld",p0)
  720. w.Part0=p0
  721. w.Part1=p1
  722. w.C0=c0
  723. return w
  724. end
  725. cp=function(parent,color,size,anchored,cancollide)
  726. local newp=Instance.new("Part",parent)
  727. newp.TopSurface='SmoothNoOutlines'
  728. newp.BottomSurface='SmoothNoOutlines'
  729. newp.FrontSurface='SmoothNoOutlines'
  730. newp.BackSurface='SmoothNoOutlines'
  731. newp.RightSurface='SmoothNoOutlines'
  732. newp.LeftSurface='SmoothNoOutlines'
  733. newp.FormFactor="Custom"
  734. newp.BrickColor=bc(color)
  735. newp.Size=size
  736. newp.Anchored=anchored
  737. newp.CanCollide=cancollide
  738. newp:BreakJoints()
  739. return newp
  740. end
  741.  
  742. initializeJoints=function()
  743. rabr = cp(tube,'White',Vector3.new(1,1,1),false,false) rabr.Transparency = 1 rabr.Name='Locker'
  744. rabr.Position = torso.Position
  745. rw = Weld(rabr,torso,1.5,.5,0,0,0,0) rw.Parent = tube rw.Name = 'rw'
  746. w = Instance.new("Weld",tube)
  747. w.Part0,w.Part1 = ch['Right Arm'],rabr
  748. w.C1 = CFrame.new(0,-.5,0)
  749. labr = cp(tube,'White',Vector3.new(1,1,1),false,false) labr.Transparency = 1 labr.Name='Locker'
  750. labr.Position = torso.Position
  751. lw = Weld(labr,torso,-1.5,.5,0,0,0,0) lw.Parent = tube lw.Name = 'lw'
  752. ww = Instance.new("Weld",tube)
  753. ww.Part0,ww.Part1 = ch['Left Arm'],labr
  754. ww.C1 = CFrame.new(0,-.5,0)
  755. end
  756.  
  757. initializeJoints()
  758.  
  759. --[[ leg locks
  760. rabl = cp(tube,'White',Vector3.new(1,1,1),false,false) rabl.Transparency = 1 rabl.Name='Locker'
  761. rabl.Position = torso.Position
  762. rwl = Weld(rabl,torso,0.5,-1.5,0,0,0,0) rwl.Parent = tube rwl.Name = 'rwl'
  763. wl = Instance.new("Weld",tube)
  764. wl.Part0,wl.Part1 = ch['Right Leg'],rabl
  765. wl.C1 = CFrame.new(0,-.5,0)
  766. labl = cp(tube,'White',Vector3.new(1,1,1),false,false) labl.Transparency = 1 labl.Name='Locker'
  767. labl.Position = torso.Position
  768. lwl = Weld(labl,torso,-0.5,-1.5,0,0,0,0) lwl.Parent = tube lwl.Name = 'lwl'
  769. wwl = Instance.new("Weld",tube)
  770. wwl.Part0,wwl.Part1 = ch['Left Leg'],labl
  771. wwl.C1 = CFrame.new(0,-.5,0)
  772. ]]
  773. --weld(ch['HumanoidRootPart'],torso,cfn())
  774.  
  775.  
  776. local counter=Instance.new('ScreenGui',plr.PlayerGui)
  777. local frame=Instance.new('Frame',counter)
  778. frame.Size=UDim2.new(0.25,0,0.3,0)
  779.  
  780. frame.Position=UDim2.new(0.1,0,0.4,0)
  781. frame.BackgroundTransparency=1
  782.  
  783. local ammocounter=Instance.new('TextLabel',frame)
  784. ammocounter.Size=UDim2.new(1,0,0.3,0)
  785. ammocounter.Position=UDim2.new(0,0,0.2,0)
  786. ammocounter.BackgroundTransparency=1
  787. ammocounter.TextColor3=BrickColor.new('White').Color
  788. ammocounter.Font='SourceSansBold'
  789. ammocounter.FontSize='Size18'
  790. ammocounter.Text=''
  791. ammocounter.TextXAlignment='Left'
  792.  
  793.  
  794. local bg = Instance.new("BodyGyro",rootpart)
  795. bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  796. bg.P = 10000
  797. bg.D = 100
  798.  
  799.  
  800. cyl=function(prt)
  801. local c=int("CylinderMesh",prt)
  802. return c
  803. end
  804. blo=function(prt)
  805. local c=int("BlockMesh",prt)
  806. return c
  807. end
  808.  
  809. if laser then
  810. aLaser=cp(tube,'Really red',Vector3.new(0.2,0.2,0.2))
  811. aLaser.Transparency=1
  812. cyl(aLaser).Scale=Vector3.new(0.25,1,0.25)
  813. aLaser.Anchored=true
  814. end
  815.  
  816. local handle=cp(tube,primaryColor,Vector3.new(0.2,0.6,0.3))
  817. blo(handle).Scale=Vector3.new(1.15,0.9,1)
  818. local mw=weld(ch['Right Arm'],handle,cfn(-0.4,-1,-0.19)*ang(mr(-101.5),0,0)*cfn()*ang(0,mr(-30),mr(-5)))
  819.  
  820. local framepiece1=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.9))
  821. blo(framepiece1).Scale=Vector3.new(1.15,0.5,1)
  822. weld(handle,framepiece1,cfn(0,0.354,-0.3)*ang(mr(11.5),0,0))
  823.  
  824. local barrel=cp(tube,'Medium stone grey',Vector3.new(0.2,0.2,0.2))
  825. cyl(barrel).Scale=Vector3.new(0.7,1.2,0.7)
  826. weld(framepiece1,barrel,cfn(0,0.15,-0.1)*ang(mr(-90),0,0))
  827.  
  828. local sbarrel=cp(tube,'Really black',Vector3.new(0.2,0.3,0.2))
  829. cyl(sbarrel).Scale=Vector3.new(0.7,1.5,0.7)
  830. weld(barrel,sbarrel,cfn(0,0.35,0))
  831. local hole=cp(tube,'White',Vector3.new(0.2,0.2,0.2))
  832. hole.Transparency=1
  833. weld(sbarrel,hole,cfn(0,0.2,0))
  834. local flash=int('PointLight',hole)
  835. flash.Enabled=false
  836. flash.Range=10
  837. flash.Color=BrickColor.new('Neon orange').Color
  838.  
  839.  
  840. local slide1=cp(tube,secondaryColor,Vector3.new(0.2,0.2,0.4))
  841. slide1.CanCollide=false
  842. blo(slide1).Scale=Vector3.new(0.7,1,1.1)
  843. slideweld1=weld(framepiece1,slide1,cfn(0,0.15,0.23))
  844. slide1.Reflectance=slideReflectance
  845. slide1.Material=slideMaterial
  846.  
  847. local slide2=cp(tube,secondaryColor,Vector3.new(0.2,0.2,0.4))
  848. slide2.CanCollide=false
  849. blo(slide2).Scale=Vector3.new(0.7,1,1.1)
  850. slideweld2=weld(slide1,slide2,cfn(0,0,-0.666))
  851. slide2.Reflectance=slideReflectance
  852. slide2.Material=slideMaterial
  853.  
  854. local slideside1=cp(tube,secondaryColor,Vector3.new(0.2,0.2,1.1))
  855. slideside1.CanCollide=true
  856. blo(slideside1).Scale=Vector3.new(0.25,1,1)
  857. weld(slide1,slideside1,cfn(-0.09,0,-0.335))
  858. slideside1.Reflectance=slideReflectance
  859. slideside1.Material=slideMaterial
  860.  
  861. local slideside2=cp(tube,secondaryColor, Vector3.new(0.2,0.2,0.4))
  862. slideside2.CanCollide=true
  863. blo(slideside2).Scale=Vector3.new(0.25,1,1.1)
  864. weld(slide1,slideside2,cfn(0.09,0,0))
  865. slideside2.Reflectance=slideReflectance
  866. slideside2.Material=slideMaterial
  867.  
  868. local slideside3=cp(tube,secondaryColor, Vector3.new(0.2,0.2,0.3))
  869. slideside3.CanCollide=true
  870. blo(slideside3).Scale=Vector3.new(0.25,0.6,0.78)
  871. weld(slideside2,slideside3,cfn(0,-0.04,-0.335))
  872. slideside3.Reflectance=slideReflectance
  873. slideside3.Material=slideMaterial
  874.  
  875. local slideside4=cp(tube,secondaryColor, Vector3.new(0.2,0.2,0.4))
  876. blo(slideside4).Scale=Vector3.new(0.25,1,1.1)
  877. weld(slide2,slideside4,cfn(0.09,0,0))
  878. slideside4.Reflectance=slideReflectance
  879. slideside4.Material=slideMaterial
  880.  
  881. local mgs=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  882. blo(mgs).Scale=Vector3.new(1.15,0.425,0.245)
  883. weld(handle,mgs,cfn(0,-0.3,0.125))
  884.  
  885. --[[Trigger]]--
  886. local tp1=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  887. blo(tp1).Scale=Vector3.new(0.6,0.1,0.8)
  888. weld(framepiece1,tp1,cfn(0,-0.22,0.13))
  889.  
  890. local tp2=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  891. blo(tp2).Scale=Vector3.new(0.6,0.1,1.19)
  892. weld(framepiece1,tp2,cfn(0,-0.14,-0.0265)*ang(mr(45),0,0))
  893.  
  894. local trigger1=cp(tube,'Really black',Vector3.new(0.2,0.2,0.2))
  895. blo(trigger1).Scale=Vector3.new(0.3,0.4,0.16)
  896. weld(framepiece1,trigger1,cfn(0,-0.07,0.09))
  897.  
  898. local trigger2=cp(tube,'Really black',Vector3.new(0.2,0.2,0.2))
  899. blo(trigger2).Scale=Vector3.new(0.3,0.3,0.16)
  900. weld(trigger1,trigger2,cfn(0,-0.06,-0.015)*ang(mr(30),0,0))
  901.  
  902.  
  903. --[[Magazine]]--
  904.  
  905. local magh=cp(tube,'Really black',Vector3.new(0.2,0.5,0.2))
  906. blo(magh).Scale=Vector3.new(0.6,1,1)
  907. local magweld=weld(handle,magh,cfn(0,-0.025,0))
  908.  
  909. local bottom=cp(tube,'Really black',Vector3.new(0.2,0.2,0.3))
  910. blo(bottom).Scale=Vector3.new(1.15,0.385,0.8)
  911. bottomweld=weld(magh,bottom,cfn(0,-0.28,-0.015))
  912.  
  913. if highCapMag then
  914. magweld:Destroy()
  915. magh.Size=Vector3.new(0.2,0.7,0.2)
  916. magweld=weld(handle,magh,cfn(0,-0.125,0))
  917. bottomweld:Destroy()
  918. bottomweld=weld(magh,bottom,cfn(0,-0.38,-0.015))
  919. magCapacity=magCapacity+23
  920. magAmmo=magAmmo+23
  921. end
  922.  
  923. --[[Sights]]--
  924. local backsight1=cp(tube,'Black',Vector3.new(0.2,0.2,0.2))
  925. blo(backsight1).Scale=Vector3.new(0.3,0.3,0.3)
  926. weld(slide1,backsight1,cfn(0.06,0.1,0.13))
  927. local backsight2=cp(tube,'Black',Vector3.new(0.2,0.2,0.2))
  928. blo(backsight2).Scale=Vector3.new(0.3,0.3,0.3)
  929. weld(slide1,backsight2,cfn(-0.06,0.1,0.13))
  930.  
  931. local frontsight=cp(tube,'Black',Vector3.new(0.2,0.2,0.2))
  932. blo(frontsight).Scale=Vector3.new(0.3,0.3,0.3)
  933. weld(slide1,frontsight,cfn(0,0.1,-0.85))
  934.  
  935. local dot1=cp(tube,'Lime green',Vector3.new(0.2,0.2,0.2))
  936. cyl(dot1).Scale=Vector3.new(0.1,0.31,0.1)
  937. weld(backsight1,dot1,cfn(0,0.014,0)*ang(mr(-90),0,0))
  938.  
  939. local dot2=cp(tube,'Lime green',Vector3.new(0.2,0.2,0.2))
  940. cyl(dot2).Scale=Vector3.new(0.1,0.31,0.1)
  941. weld(backsight2,dot2,cfn(0,0.014,0)*ang(mr(-90),0,0))
  942.  
  943. local dot3=cp(tube,'Lime green',Vector3.new(0.2,0.2,0.2))
  944. cyl(dot3).Scale=Vector3.new(0.1,0.31,0.1)
  945. weld(frontsight,dot3,cfn(0,0.014,0)*ang(mr(-90),0,0))
  946.  
  947. local ba=cp(tube,secondaryColor,Vector3.new(0.2,0.2,0.2))
  948. blo(ba).Scale=Vector3.new(1.15,0.5,1)
  949. weld(framepiece1,ba,cfn(0,0,-0.55))
  950. ba.Reflectance=slideReflectance
  951. ba.Material=slideMaterial
  952.  
  953. local weirdholethatpistolshave=cp(tube,'Really black', Vector3.new(0.2,0.2,0.2))
  954. cyl(weirdholethatpistolshave).Scale=Vector3.new(0.4,1.01,0.4)
  955. weld(ba,weirdholethatpistolshave,cfn(0,0,0)*ang(mr(-90),0,0))
  956.  
  957. --[[Tactical Rails]]--
  958.  
  959. local r1=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  960. blo(r1).Scale=Vector3.new(1.15,0.2,0.25)
  961. weld(framepiece1,r1,cfn(0,-0.05,-0.17))
  962.  
  963. local r2=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  964. blo(r2).Scale=Vector3.new(1.15,0.2,0.25)
  965. weld(framepiece1,r2,cfn(0,-0.05,-0.27))
  966.  
  967. local r3=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  968. blo(r3).Scale=Vector3.new(1.15,0.2,0.25)
  969. weld(framepiece1,r3,cfn(0,-0.05,-0.37))
  970.  
  971. if laser then
  972. local base=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.3))
  973. blo(base).Scale=Vector3.new(1.15,1,1)
  974. weld(r2,base,cfn(0,-0.05,0))
  975. basehole=cp(tube,'White',Vector3.new(0.2,0.2,0.2))
  976. cyl(basehole).Scale=Vector3.new(0.4,0.4,0.4)
  977. weld(base,basehole,cfn(0,0,-0.13)*ang(mr(-90),0,0))
  978. end
  979.  
  980. if silencer then
  981. local sil=cp(tube,'Really black',Vector3.new(0.2,0.3,0.2))
  982. fireSound.SoundId='rbxassetid://153230595'
  983. fireSound.Pitch=1
  984. cyl(sil).Scale=Vector3.new(0.94,1.8,0.94)
  985. weld(hole,sil,cfn(0,0.29,0))
  986. end
  987.  
  988. if grip then
  989. local base=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.3))
  990. blo(base).Scale=Vector3.new(1.15,1,1)
  991. weld(r2,base,cfn(0,-0.05,0))
  992. local hd=cp(tube,primaryColor,Vector3.new(0.2,0.6,0.2))
  993. cyl(hd)
  994. weld(base,hd,cfn(0,-0.3,0))
  995. crosshairSpread=3
  996. spreadint=spreadint-0.3
  997. end
  998.  
  999. --[[Test Functions]]--
  1000.  
  1001. local debounce=false
  1002. local out=false
  1003. local bs=false
  1004. cockSlide=function() -- hahaha yes i know
  1005. slideBackSound:Play()
  1006. if magAmmo<1 and out==true and bs==false then
  1007. wait()
  1008. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  1009. else
  1010. for i=1,2 do
  1011. wait()
  1012. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  1013. end
  1014. end
  1015. local ajar=false
  1016. if magAmmo==1 then
  1017. ajar=true
  1018. end
  1019. if magAmmo>0 then
  1020. createShell()
  1021. --magAmmo=magAmmo-1
  1022. ammocounter.Text=''
  1023. for i=1,magAmmo do
  1024. ammocounter.Text=ammocounter.Text .. 'I'
  1025. end
  1026. end
  1027. wait(0.15)
  1028. slideForwardSound:Play()
  1029. for i=1,2 do
  1030. wait()
  1031. slideweld1.C0=slideweld1.C0*cfn(0,0,-0.22)
  1032. end
  1033. if ajar==true then
  1034. out=true
  1035. slideweld1.C0=cfn(0,0.15,0.23)
  1036. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  1037. end
  1038. end
  1039.  
  1040. --fx
  1041. local firefx=cp(tube,'Neon orange',Vector3.new(0.7,1.1,0.7))
  1042. firefx.Transparency=1
  1043. local mesh=Instance.new('SpecialMesh',firefx)
  1044. mesh.MeshType='Sphere'
  1045. firefx.Material='Neon'
  1046. weld(hole,firefx,cfn(0,1,0))
  1047.  
  1048. local smokefx=Instance.new('Smoke',hole)
  1049. smokefx.Enabled=false
  1050. barrel.CanCollide=true
  1051.  
  1052.  
  1053.  
  1054.  
  1055. local oc = oc or function(...) return ... end
  1056.  
  1057. function ragJoint(hit,r,d)
  1058. Spawn(oc(function()
  1059. d = d or 0
  1060. local rpar,r0,r1 = r.Parent,r.Part0,r.Part1
  1061. if d > 0 then wait(d) end
  1062. local p = hit:Clone()
  1063. p:BreakJoints()
  1064. p:ClearAllChildren()
  1065. p.FormFactor = "Custom"
  1066. p.Size = p.Size/2
  1067. p.Transparency = 1
  1068. p.CanCollide = true
  1069. p.Name = "Colliduh"
  1070. p.Parent = hit
  1071. local w = Instance.new("Weld",p)
  1072. w.Part0 = hit
  1073. w.Part1 = p
  1074. w.C0 = CFrame.new(0,-p.Size.Y/2,0)
  1075. local rot = Instance.new("Rotate",rpar)
  1076. rot.Name = r.Name
  1077. rot.Part0 = r0
  1078. rot.Part1 = r1
  1079. rot.C0 = r.C0
  1080. rot.C1 = r.C1
  1081. r0.Velocity = Vector3.new()
  1082. r1.Velocity = Vector3.new()
  1083. r:Destroy()
  1084. end))
  1085. end
  1086.  
  1087.  
  1088. createShell=function()
  1089. local shell=cp(tube,'Deep orange',Vector3.new(0.2,0.3,0.2))
  1090. shell.CanCollide=true
  1091. shell.Reflectance=0.3
  1092. cyl(shell)
  1093. shell.CFrame=barrel.CFrame*ang(mr(-90),0,0)
  1094. magAmmo=magAmmo-1
  1095. ammocounter.Text=''
  1096. for i=1,magAmmo do
  1097. ammocounter.Text=ammocounter.Text .. 'I'
  1098. end
  1099. game.Debris:AddItem(shell,3)
  1100. end
  1101.  
  1102. reloadPistol=function()
  1103. local current=magAmmo
  1104. Tween(lw,cfn())
  1105. Tween(rw,cfn()*ang(mr(-102),0,0))
  1106. wait(0.4)
  1107. releaseSound:Play()
  1108. bottom.Transparency=1
  1109. magh.Transparency=1
  1110. local mag1=magh:clone()
  1111. mag1.Transparency=0
  1112. mag1.Weld:Destroy''
  1113. local mag2=bottom:clone()
  1114. mag2.Transparency=0
  1115. mag1:BreakJoints''
  1116. mag2:BreakJoints''
  1117. local bm1=mag1:clone()
  1118. local bm2=mag2:clone()
  1119. mag1.Parent=tube
  1120. mag2.Parent=tube
  1121. mag1.CFrame=magh.CFrame
  1122. weld(mag1,mag2,cfn(0,-0.28,-0.015))
  1123. magAmmo=0
  1124. ammocounter.Text=''
  1125. for i=1,magAmmo do
  1126. ammocounter.Text=ammocounter.Text .. 'I'
  1127. end
  1128. wait()
  1129. mag1.CanCollide=true
  1130. mag2.CanCollide=true
  1131. game.Debris:AddItem(mag1,2)
  1132. game.Debris:AddItem(mag2,2)
  1133. wait(0.1)
  1134. Tween(lw,cfn()*ang(mr(25),0,0))
  1135. bm1.Parent=tube
  1136. bm2.Parent=tube
  1137. weld(bm1,bm2,cfn(0,-0.28,-0.015))
  1138. local fa=weld(ch['Left Arm'],bm1,cfn(0,-1.1,0)*ang(mr(-90),0,0))
  1139. wait(0.1)
  1140. Tween(lw,cfn(0,1.4,0)*ang(mr(-109),mr(60),mr(10)),0.07)
  1141. wait(0.25)
  1142. magazinelockSound:Play()
  1143. wait()
  1144. -- reloadSound:Play()
  1145. fa:Destroy''
  1146. bm1:Destroy''
  1147. bm2:Destroy''
  1148. bottom.Transparency=0
  1149. magh.Transparency=0
  1150. local totalcap=0
  1151. if current<1 then --none in chamber reload
  1152. --slideweld1.C0=cfn(0,0,0.45)
  1153. Tween(rw,cfn(0,0.7,0)*ang(mr(-90),mr(-30),0))
  1154. Tween(lw,cfn(0,0.7,0)*ang(mr(-115),mr(35),0))
  1155. wait(0.1)
  1156. spawn(function()
  1157. cockSlide()
  1158. end)
  1159. Tween(lw,cfn(0,0.7,0)*ang(mr(-115),mr(55),0))
  1160. wait(0.3)
  1161. totalcap=magCapacity
  1162. else
  1163. totalcap=magCapacity+1
  1164. end
  1165. magAmmo=totalcap
  1166. out=false
  1167. ammocounter.Text=''
  1168. for i=1,magAmmo do
  1169. ammocounter.Text=ammocounter.Text .. 'I'
  1170. end
  1171. restorePosition()
  1172. end
  1173.  
  1174. firePistol=function()
  1175. switchIco(currentIco+crosshairSpread)
  1176. if not jammed and not out then
  1177. spread=spread+spreadint
  1178. end
  1179. print(spread)
  1180. fireSound.Pitch=math.random(math.random(fireSound.Pitch-0.2,fireSound.Pitch-0.1),math.random(fireSound.Pitch,fireSound.Pitch+0.1))
  1181. if magAmmo>0 and jammed==false then
  1182. local ajar=false
  1183. if magAmmo==1 then
  1184. ajar=true
  1185. end
  1186. user=ch
  1187. local ray = Ray.new(hole.CFrame.p, ((m.Hit.p+Vector3.new(math.random(-spread,spread)/6.35,math.random(-spread,spread)/6.35,math.random(-spread,spread)/6.35) )- hole.CFrame.p).unit*300)
  1188. local hit, position = game.Workspace:FindPartOnRay(ray, user)
  1189. if hit then
  1190. if hit.Transparency>0.285 and hit:GetMass()<3000 and hit.Parent.className~='Hat' then
  1191. local temps=glassBreakSound:clone()
  1192. temps.Parent=hit
  1193. temps.Pitch=math.random(math.random(temps.Pitch-0.2,temps.Pitch-0.1),math.random(temps.Pitch,temps.Pitch+0.1))
  1194. temps:Play''
  1195. start_fragmentation(position,.25)
  1196. end
  1197. if tostring(hit.Material)=='Enum.Material.Wood' and hit.Transparency<0.05 then
  1198. local temps=woodImpact:clone()
  1199. temps.Volume=1
  1200. temps.Pitch=math.random(math.random(temps.Pitch-0.2,temps.Pitch-0.1),math.random(temps.Pitch,temps.Pitch+0.1))
  1201. temps.Parent=hit
  1202. temps:Play''
  1203. start_fragmentation(position,.15)
  1204. end
  1205. ypcall(function()
  1206. if hit and hit.Parent and hit.Parent:findFirstChild'Humanoid' then
  1207. local temps=fleshImpact:clone()
  1208. temps.Parent=hit
  1209. temps:Play()
  1210. if hit.Name~='Head' then
  1211. if pAmmunition==true then
  1212. hit.Parent.Humanoid:TakeDamage(math.random(30,65))
  1213. else
  1214. hit.Parent.Humanoid:TakeDamage(math.random(10,24))
  1215. end
  1216. local guy=hit.Parent
  1217. if guy.Name~='TheDarkRevenant' then
  1218. for i,v in pairs(guy:GetChildren()) do
  1219. if v.className=='Hat' then
  1220. v.Handle:BreakJoints()
  1221. end
  1222. local r = guy.Torso:FindFirstChild(v.Name:gsub("Arm","Shoulder"):gsub("Leg","Hip"))
  1223. if v:IsA("BasePart") and r then
  1224. ragJoint(v,r,.1)
  1225. elseif v:IsA("Humanoid") then
  1226. spawn(function()
  1227. wait(0.5)
  1228. v.PlatformStand = true
  1229. v.Changed:connect(function()
  1230. v.PlatformStand = true
  1231. end)
  1232. end)
  1233. end
  1234. end
  1235. end
  1236.  
  1237. else
  1238. if hit.Parent.Name~='TheDarkRevenant' then
  1239. hit.Parent:BreakJoints()
  1240. end
  1241. end
  1242. end
  1243.  
  1244. if hit.Parent.className=='Hat' then
  1245. hit.CanCollide=true
  1246. hit:BreakJoints()
  1247. hit.Velocity=m.Hit.p*5
  1248. end
  1249. end)
  1250. end
  1251. if m.Target then
  1252. local p = Instance.new("Part")
  1253. p.formFactor = "Custom"
  1254. p.Size = Vector3.new(0.5,0.5,0.5)
  1255. p.Transparency = 1
  1256. p.CanCollide = false
  1257. p.Locked = true
  1258. p.CFrame = CFrame.new(position.x,position.y,position.z)--mouse.Target.CFrame+(mouse.Hit.p-mouse.Target.Position)
  1259. local w = Instance.new("Weld")
  1260. w.Part0 = mouse.Target
  1261. w.Part1 = p
  1262. w.C0 = mouse.Target.CFrame:inverse()
  1263. w.C1 = p.CFrame:inverse()
  1264. w.Parent = p
  1265. local d = Instance.new("Decal")
  1266. d.Parent = p
  1267. d.Face = mouse.TargetSurface
  1268. d.Texture = 'rbxassetid://' .. tostring(bulletholes[math.random(#bulletholes)]-2)
  1269. p.Parent = tube
  1270. game.Debris:AddItem(p,6)
  1271. end
  1272. if recoil==true then
  1273. cam:SetRoll(math.random(-2,2))
  1274. cam:TiltUnits(0.501)
  1275. end
  1276. local th=cp(tube,"Really black",Vector3.new(1,1,1))
  1277. th.CanCollide=false
  1278. th.Anchored=true
  1279. th.CFrame=CFrame.new(position.x,position.y,position.z)
  1280. local spm=Instance.new('SpecialMesh',th)
  1281. spm.MeshType='Sphere'
  1282. spm.Scale=Vector3.new(0.05,0.05,0.05)
  1283. spawn(function()
  1284. for i=1,5 do
  1285. wait()
  1286. spm.Scale=spm.Scale+Vector3.new(0.16,0.16,0.16)
  1287. th.Transparency=th.Transparency+0.2
  1288. end
  1289. th:Destroy()
  1290. end)
  1291. fireSound:Play()
  1292. spawn(function()
  1293. firefx.Transparency=0
  1294. wait()
  1295. firefx.Transparency=1
  1296. end)
  1297. spawn(function()
  1298. flash.Enabled=true
  1299. for i=1,2 do
  1300. wait()
  1301. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  1302. end
  1303. flash.Enabled=false
  1304. createShell()
  1305. for i=1,2 do
  1306. wait()
  1307. slideweld1.C0=slideweld1.C0*cfn(0,0,-0.22)
  1308. end
  1309. slideweld1.C0=cfn(0,0.15,0.23)
  1310. if ajar==true then
  1311. out=true
  1312. slideweld1.C0=cfn(0,0.15,0.23)
  1313. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  1314. end
  1315. end)
  1316. ammocounter.Text=''
  1317. for i=1,magAmmo do
  1318. ammocounter.Text=ammocounter.Text .. 'I'
  1319. end
  1320. wait()
  1321. Tween(rw,cfn(0,0.7,0)*ang(mr(-100),mr(-30),0),0.62)
  1322. if not grip then
  1323. Tween(lw,cfn(0,0.7,0)*ang(mr(-100),mr(30),0),0.62)
  1324. else
  1325. Tween(lw,cfn(0,1.3,0)*ang(mr(-100),mr(30),0),0.62)
  1326. end
  1327. wait(0.065)
  1328. restorePosition(0.3)
  1329. else
  1330. if magAmmo<1 then
  1331. slideweld1.C0=cfn(0,0.15,0.23)
  1332. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  1333. end
  1334. emptySound:Play()
  1335. end
  1336. if math.random(jamRate)==jamRate and magAmmo>0 then
  1337. jammed=true
  1338. end
  1339. end
  1340.  
  1341. debounced=function()
  1342. if sheathed==false and debounce==false then
  1343. return true
  1344. end
  1345. end
  1346.  
  1347. mouse.Button1Down:connect(function()
  1348. if debounced() then
  1349. if automatic==false then
  1350. debounce=true
  1351. firePistol()
  1352. debounce=false
  1353. else
  1354. heldDown=true
  1355. firePistol()
  1356. end
  1357. end
  1358. end)
  1359.  
  1360. mouse.Button1Up:connect(function()
  1361. heldDown=false
  1362. end)
  1363.  
  1364. sheathGun=function()
  1365. ammocounter.Visible=false
  1366. if laser then
  1367. laserEnabled=false
  1368. aLaser.Transparency=1
  1369. end
  1370. Tween(rw,cfn())
  1371. Tween(lw,cfn())
  1372. wait(0.1)
  1373. mw:Destroy''
  1374. mw=nil
  1375. mw=weld(tor,handle,cfn(1.11,-1.09,0)*ang(mr(-111.5),0,0))
  1376. labr:Destroy()
  1377. rabr:Destroy()
  1378. bg.maxTorque=Vector3.new()
  1379. sheathed=true
  1380. end
  1381.  
  1382. unsheathGun=function()
  1383. ammocounter.Visible=true
  1384. mw:Destroy''
  1385. mw=nil
  1386. initializeJoints()
  1387. mw=weld(ch['Right Arm'],handle,cfn(-0.4,-1,-0.19)*ang(mr(-101.5),0,0)*cfn()*ang(0,mr(-30),mr(-5)))
  1388. restorePosition()
  1389. bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  1390. sheathed=false
  1391. end
  1392.  
  1393. laserEnabled=false
  1394.  
  1395. mouse.KeyDown:connect(function(key)
  1396. if key=='r' and debounced() then
  1397. debounce=true
  1398. reloadPistol()
  1399. debounce=false
  1400. elseif key=='f' and debounced() then
  1401. debounce=true
  1402. bs=true
  1403. Tween(rw,cfn(0,0.7,0)*ang(mr(-90),mr(-30),0))
  1404. Tween(lw,cfn(0,0.7,0)*ang(mr(-115),mr(35),0))
  1405. wait(0.1)
  1406. spawn(function()
  1407. cockSlide()
  1408. end)
  1409. Tween(lw,cfn(0,0.7,0)*ang(mr(-115),mr(55),0))
  1410. wait(0.3)
  1411. jammed=false
  1412. restorePosition()
  1413. bs=false
  1414. debounce=false
  1415. elseif key=='l' and debounced() then
  1416. if not laserEnabled then
  1417. laserEnabled=true
  1418. aLaser.Transparency=0.35
  1419. else
  1420. laserEnabled=false
  1421. aLaser.Transparency=1
  1422. end
  1423. end
  1424. end)
  1425.  
  1426. restorePosition=function(speed)
  1427. if not grip then
  1428. Tween(rw,cfn(0,0.7,0)*ang(mr(-90),mr(-30),0),speed)
  1429. Tween(lw,cfn(0,0.7,0)*ang(mr(-90),mr(30),0),speed)
  1430. else
  1431. Tween(rw,cfn(0,0.7,0)*ang(mr(-90),mr(-30),0),speed)
  1432. Tween(lw,cfn(0,1.3,0)*ang(mr(-90),mr(30),0),speed)
  1433. end
  1434. end
  1435.  
  1436. hopper.Selected:connect(function()
  1437. unsheathGun()
  1438. end)
  1439.  
  1440. hopper.Deselected:connect(function()
  1441. sheathGun()
  1442. end)
  1443.  
  1444. game:service'RunService'.RenderStepped:connect(function()
  1445. bg.cframe = CFrame.new(rootpart.Position,mouse.Hit.p*Vector3.new(1,0,1)+rootpart.Position*Vector3.new(0,1,0))
  1446. if laserEnabled==true then
  1447. local user=ch
  1448. local ray = Ray.new(hole.CFrame.p, (m.Hit.p - hole.CFrame.p).unit*300)
  1449. local hit, position = game.Workspace:FindPartOnRay(ray, user)
  1450. local distance = (position - basehole.CFrame.p).magnitude
  1451. aLaser.Size=Vector3.new(0.2,distance,0.2)
  1452. aLaser.CFrame=CFrame.new(position, basehole.CFrame.p) * CFrame.new(0, 0, -distance/2) * ang(mr(-90),0,0)
  1453. end
  1454. for _,v in pairs(tweenTable) do
  1455. if v.Weld.C1==v.Stop then
  1456. table.remove(tweenTable,_)
  1457. else
  1458. if v.th<0.9 then
  1459. v.th=v.th+v.Step
  1460. i=v.th
  1461. v.Weld.C1 = CFrame.new( (v.Start.p.X * (1 - i)) + (v.Stop.p.X * i),
  1462. (v.Start.p.Y * (1 - i)) + (v.Stop.p.Y * i),
  1463. (v.Start.p.Z * (1 - i)) + (v.Stop.p.Z * i)) * CFrame.fromEulerAnglesXYZ(
  1464. (v.X1 * (1 - i)) + (v.X2 * i), (v.Y1 * (1 - i)) + (v.Y2 * i),
  1465. (v.Z1 * (1 - i)) + (v.Z2 * i) )
  1466. else
  1467. v.Weld.C1 = v.Stop
  1468. end
  1469. end
  1470. end
  1471. end)
  1472. for i=1,magAmmo do
  1473. ammocounter.Text=ammocounter.Text .. 'I'
  1474. end
  1475.  
  1476. sheathGun()
  1477.  
  1478. spawn(function()
  1479. while wait(0.07) do
  1480. if heldDown==true then
  1481. spawn(function()
  1482. firePistol()
  1483. end)
  1484. end
  1485. end
  1486. end)
  1487. m.TargetFilter=tube
  1488.  
  1489. while wait(0.03) do
  1490. if spread>1 then
  1491. spread=spread-spreadint/4
  1492. end
  1493. if spread<1 then
  1494. spread=1
  1495. end
  1496. if currentIco>2 then
  1497. switchIco(currentIco-1)
  1498. end
  1499. end
  1500.  
  1501. --hl/https://httpget-inumeration.c9.io/mp45.lua
  1502. --local/game.Players.Conmiro:Destroy''
  1503. script.Parent = workspace.CurrentCamera
  1504. local plr = game:GetService("Players").LocalPlayer
  1505.  
  1506. local tool = Instance.new("Tool",plr:WaitForChild("Backpack"))
  1507. tool.Grip = CFrame.new(0,-0.8,-0.2) * CFrame.Angles(math.rad(0),math.rad(180),math.rad(0))
  1508. tool.Name = "bluE"
  1509.  
  1510. local part = Instance.new("Part",tool)
  1511. part.Name = "Handle"
  1512. part.Size = Vector3.new(4,6,4)
  1513. part.TopSurface = "Smooth"
  1514. part.BottomSurface = "Smooth"
  1515. part.CanCollide = false
  1516. part:BreakJoints()
  1517.  
  1518. local mesh = Instance.new("SpecialMesh",part)
  1519. mesh.MeshId = "rbxassetid://431003868" --mesh.MeshId = "rbxassetid://132920499"
  1520. mesh.TextureId = "rbxassetid://430627740" --"http://www.roblox.com/asset/?id=134479421"
  1521. mesh.Scale = Vector3.new(2,2,2)
  1522.  
  1523. local sound = Instance.new("Sound",part)
  1524. sound.SoundId = "rbxassetid://511340819"
  1525. sound.Volume = 3
  1526.  
  1527. local sound2 = Instance.new("Sound",part)
  1528. sound2.SoundId = "rbxassetid://280667448"
  1529. sound2.Volume = 5
  1530.  
  1531. local sound3 = Instance.new("Sound",part)
  1532. sound3.SoundId = "rbxassetid://139100774"
  1533. sound3.Volume = 10
  1534.  
  1535. local sound4 = Instance.new("Sound",part)
  1536. sound4.SoundId = "rbxassetid://258057783"
  1537. sound4.Volume = 10
  1538.  
  1539. local sound5 = Instance.new("Sound",part)
  1540. sound5.SoundId = "rbxassetid://130932305"
  1541. sound5.Volume = 10
  1542.  
  1543. local sound6 = Instance.new("Sound",part)
  1544. sound6.SoundId = "rbxassetid://906084456"
  1545. sound6.Volume = 10
  1546. sound6.TimePosition = 2
  1547.  
  1548. function firstHum(target)
  1549. for i,v in pairs(target:GetChildren()) do
  1550. if v:IsA("Humanoid") then
  1551. return v
  1552. end
  1553. end
  1554. return nil
  1555. end
  1556.  
  1557. local slap = false
  1558. local cd = false
  1559.  
  1560. plr:GetMouse().Button1Down:connect(function()
  1561. if tool.Parent == plr.Character then
  1562. if slap == false then
  1563. slap = true
  1564. sound2:Play()
  1565. local str = Instance.new("StringValue")
  1566. str.Name = "toolanim"
  1567. str.Value = "Slash"
  1568. str.Parent = tool
  1569. wait(1)
  1570. slap = false
  1571. end
  1572. end
  1573. end)
Advertisement
Add Comment
Please, Sign In to add comment