Advertisement
TheUnknownDiscord

nailgun

Mar 14th, 2022 (edited)
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.86 KB | None | 0 0
  1. local dmgd = {}
  2. local c = {}
  3. local nailg = Instance.new("Sound")
  4. nailg.SoundId = "rbxassetid://7312769496"
  5. owner.Character.Humanoid.WalkSpeed = 20
  6. nailg.PlayOnRemove = true
  7. nailg.Volume = 1.5
  8. nailg.PlaybackSpeed = 1
  9. local s1,s2,s3 = "rbxassetid://7312769496","rbxassetid://7312770494","rbxassetid://7312768500"
  10. local medicl = Instance.new("Sound")
  11. medicl.SoundId = "rbxassetid://435756212"
  12. medicl.Volume = 1.5
  13. local toolout = false
  14. local s1,s2,s3 = "rbxassetid://7312769496","rbxassetid://7312770494","rbxassetid://7312768500"
  15. local rayblacklist = {}
  16. tool = Instance.new("Tool",owner.Backpack)
  17. tool.Name = "Nailgun"
  18. dmg = 5
  19. nailgun = Instance.new("Part",tool)
  20. nailgun.Name = "Handle"
  21. drum = Instance.new("Part",nailgun)
  22. Mesh = Instance.new("SpecialMesh")
  23. Mesh.Parent = nailgun
  24. Mesh.MeshId = "http://www.roblox.com/asset/?id=7572360356"
  25. Mesh.TextureId = "http://www.roblox.com/asset/?id=7572369900"
  26. Mesh.Scale = Vector3.new(0.1, 0.1, 0.1)
  27. Mesh2 = Instance.new("SpecialMesh")
  28. Mesh2.Parent = drum
  29. Mesh2.MeshId = "http://www.roblox.com/asset/?id=7572364835"
  30. Mesh2.TextureId = "http://www.roblox.com/asset/?id=7572369900"
  31. Mesh2.Scale = Vector3.new(0.1, 0.1, 0.1)
  32. nailgun.Size = Vector3.new(0.549, 1.779,2.12325)
  33. drum.Size = Vector3.new(1.311, 1.8456,1.19775)
  34. local weld = Instance.new("Weld",nailgun)
  35. weld.Part0 = drum
  36. weld.Part1 = nailgun
  37. weld.C0 = CFrame.new(0,0.425,0.275)
  38. tool.Grip = CFrame.new(0,-0.25,0.25) * CFrame.Angles(0,math.rad(15),0)
  39. local weld2 = Instance.new("Weld",owner.Character.Torso)
  40. weld2.Part0 = owner.Character["Left Arm"]
  41. weld2.Part1 = owner.Character.Torso
  42. weld2.C0 = CFrame.Angles(math.rad(-80),math.rad(65),0) * CFrame.new(0.25,-0.35,1.75)
  43. local weld3 = Instance.new("Weld",owner.Character.Torso)
  44. weld3.Part0 = owner.Character["Right Arm"]
  45. weld3.Part1 = owner.Character.Torso
  46. weld3.C0 = CFrame.Angles(math.rad(-90),math.rad(-15),0) * CFrame.new(-1,-0.45,1)
  47. weld3.Enabled = false
  48. weld2.Enabled = false
  49. drum.Massless = true
  50. tool.Equipped:Connect(function()
  51. toolout = true
  52. weld3.Enabled = true
  53. drum.CanCollide = false
  54. weld2.Enabled = true
  55. nailg.Parent = nailgun
  56. nailg.PlaybackSpeed = 2
  57. nailg.SoundId = s3
  58. nailg.Parent = nil
  59. end)
  60. tool.Unequipped:Connect(function()
  61. toolout = false
  62. weld3.Enabled = false
  63. weld2.Enabled = false
  64. drum.CanCollide = true
  65. nailg.Parent = nailgun
  66. nailg.PlaybackSpeed = 2
  67. nailg.SoundId = s3
  68. nailg.Parent = nil
  69. end)
  70. local tweenService = game:GetService("TweenService")
  71. local timeToFade = 2
  72. local object = weld3
  73. local object2 = weld2
  74. local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Linear)
  75. local timeToFade2 = 0.0575
  76. local tweenInfo2 = TweenInfo.new(timeToFade2,Enum.EasingStyle.Linear)
  77. local timeToFade3 = 0.35
  78. local tweenInfo3 = TweenInfo.new(timeToFade3,Enum.EasingStyle.Linear)
  79. local timeToFade4 = 0.125
  80. local tweenInfo4 = TweenInfo.new(timeToFade4,Enum.EasingStyle.Linear)
  81. local goal = {}
  82. goal.C0 = CFrame.Angles(math.rad(-89),math.rad(-16),0) * CFrame.new(-0.95,-0.5,1.05)
  83.  
  84. local tween = tweenService:Create(object, tweenInfo, goal)
  85. local goal2 = {}
  86. goal2.C0 = CFrame.Angles(math.rad(-79),math.rad(66),0) * CFrame.new(0.3,-0.4,1.75)
  87.  
  88. local tween2 = tweenService:Create(object2, tweenInfo, goal2)
  89. local goal3 = {}
  90. goal3.C0 = CFrame.Angles(math.rad(-90),math.rad(-15),0) * CFrame.new(-1,-0.45,1)
  91.  
  92. local tween3 = tweenService:Create(object, tweenInfo, goal3)
  93. local goal4 = {}
  94. goal4.C0 = CFrame.Angles(math.rad(-80),math.rad(65),0) * CFrame.new(0.25,-0.35,1.65)
  95.  
  96. local tween4 = tweenService:Create(object2, tweenInfo, goal4)
  97. local goal5 = {}
  98. goal5.C0 = CFrame.Angles(math.rad(-95),math.rad(-15),0) * CFrame.new(-1,-0.5,1.325)
  99.  
  100. local tween5 = tweenService:Create(object, tweenInfo2, goal5)
  101. local goal6 = {}
  102. goal6.C0 = CFrame.Angles(math.rad(-85),math.rad(65),0) * CFrame.new(0.25,-0.4,1.67)
  103.  
  104. local tween6 = tweenService:Create(object2, tweenInfo2, goal6)
  105. local goal7 = {}
  106. goal7.C0 = CFrame.Angles(math.rad(-90),math.rad(-15),0) * CFrame.new(-1,-0.45,1)
  107.  
  108. local tween7 = tweenService:Create(object, tweenInfo2, goal7)
  109. local goal8 = {}
  110. goal8.C0 = CFrame.Angles(math.rad(-80),math.rad(65),0) * CFrame.new(0.25,-0.35,1.5)
  111.  
  112. local tween8 = tweenService:Create(object2, tweenInfo2, goal8)
  113. local goal9 = {}
  114. goal9.C0 = CFrame.Angles(math.rad(-90),math.rad(-15),math.rad(55)) * CFrame.new(-1,-0.45,1)
  115.  
  116. local tween9 = tweenService:Create(object, tweenInfo2, goal9)
  117. local goal11 = {}
  118. goal11.C0 = CFrame.Angles(math.rad(10),math.rad(15),0) * CFrame.new(1,0.25,-0.5)
  119.  
  120. local tween11 = tweenService:Create(object2, tweenInfo3, goal11)
  121. local goal12 = {}
  122. goal12.C0 = CFrame.Angles(math.rad(-80),math.rad(65),0) * CFrame.new(0.25,-0.35,1.75)
  123.  
  124. local tween12 = tweenService:Create(object2, tweenInfo3, goal12)
  125. local goal17 = {}
  126. goal17.C0 = CFrame.Angles(math.rad(-160),math.rad(5),0) * CFrame.new(0.75,-0.5,0.5)
  127.  
  128. local tween17 = tweenService:Create(object2, tweenInfo3, goal17)
  129. local goal18 = {}
  130. goal18.C0 = CFrame.Angles(math.rad(-85),math.rad(5),0) * CFrame.new(0.75,-0.85,1.5)
  131.  
  132. local tween18 = tweenService:Create(object2, tweenInfo2, goal18)
  133. local goal13 = {}
  134. goal13.C0 = CFrame.Angles(math.rad(-90),math.rad(-15),0) * CFrame.new(-1,-0.45,1)
  135.  
  136. local tween13 = tweenService:Create(object, tweenInfo3, goal13)
  137. local goal15 = {}
  138. goal15.C0 = CFrame.Angles(math.rad(-10),math.rad(-15),0) * CFrame.new(-1.35,-0.125,0.5)
  139.  
  140. local tween15 = tweenService:Create(object, tweenInfo2, goal15)
  141. local goal16 = {}
  142. goal16.C0 = CFrame.Angles(math.rad(-150),math.rad(45),0) * CFrame.new(1.25,-1,0.75)
  143.  
  144. local tween16 = tweenService:Create(object2, tweenInfo2, goal16)
  145. local goal20 = {}
  146. goal20.Grip = tool.Grip
  147.  
  148. local tween20 = tweenService:Create(tool, tweenInfo4, goal20)
  149. tween:Play()
  150. tween2:Play()
  151. local reloading = false
  152. tween.Completed:Connect(function()
  153. if not reloading then
  154. tween3:Play()
  155. tween4:Play()
  156. end
  157. end)
  158. tween3.Completed:Connect(function()
  159. if not reloading then
  160. tween:Play()
  161. tween2:Play()
  162. end
  163. end)
  164. local active = false
  165. local ammo = 100
  166. tool.Activated:Connect(function()
  167. if ammo > 0 then
  168. tween:Cancel()
  169. tween2:Cancel()
  170. tween3:Cancel()
  171. tween4:Cancel()
  172. weld2.C0 = CFrame.Angles(math.rad(-80),math.rad(65),0) * CFrame.new(0.25,-0.35,1.5)
  173. weld3.C0 = CFrame.Angles(math.rad(-90),math.rad(-15),0) * CFrame.new(-1,-0.45,1)
  174. active = true
  175. end
  176. end)
  177. tool.Deactivated:Connect(function()
  178. if ammo > 0 then
  179. active = false
  180. tween20.Completed:Wait()
  181. tween:Play()
  182. tween2:Play()
  183. end
  184. end)
  185. local e = Instance.new("RemoteEvent",owner.Character)
  186. NLS([[
  187. print("r = reload")
  188. print("m = mEdICc")
  189. print('n = throw your "mad milk"')
  190. local iactive = false
  191. local e = script.Parent
  192. game:GetService("RunService").RenderStepped:Connect(function()
  193. if (workspace.CurrentCamera.CFrame.p - owner.Character.Head.Position).magnitude <= 1.7 then
  194. workspace.CurrentCamera.FieldOfView = 100
  195. owner.Character.Humanoid.CameraOffset = Vector3.new(0,0.25,-0.25)
  196. for i,v in pairs(owner.Character:GetChildren()) do
  197. if v.ClassName == "Part" or v.ClassName == "MeshPart" and v.Name ~= "Head" then
  198. v.LocalTransparencyModifier = 0
  199. end
  200. if v.ClassName == "Accessory" then
  201. v.Handle.Transparency = 1
  202. end
  203. end
  204. if owner.Character.Head:findFirstChildOfClass("Decal") then
  205. owner.Character.Head:findFirstChildOfClass("Decal").Transparency = 1
  206. end
  207. owner.Character.Head.Transparency = 1
  208. else
  209. owner.Character.Humanoid.CameraOffset = Vector3.new(0,0,0)
  210. for i,v in pairs(owner.Character:GetChildren()) do
  211. if v.ClassName == "Accessory" then
  212. v.Handle.Transparency = 0
  213. end
  214. end
  215. workspace.CurrentCamera.FieldOfView = 70
  216. owner.Character.Head.Transparency = 0
  217. if owner.Character.Head:findFirstChildOfClass("Decal") then
  218. owner.Character.Head:findFirstChildOfClass("Decal").Transparency = 0
  219. end
  220. end
  221. end)
  222. mouse = owner:GetMouse()
  223. mouse.Button1Down:Connect(function()
  224. iactive = true
  225. end)
  226. mouse.Button1Up:Connect(function()
  227. iactive = false
  228. end)
  229. mouse.KeyDown:Connect(function(key)
  230. key = key:lower()
  231. if key == "r" then
  232. e:FireServer("reload")
  233. elseif key == "m" then
  234. e:FireServer("medic")
  235. elseif key == "n" then
  236. e:FireServer("milmk",mouse.Hit)
  237. end
  238. end)
  239. while task.wait() do
  240. if iactive then
  241. e:FireServer("fire",mouse.Hit)
  242. wait(1/32)
  243. end
  244. end
  245. ]],e)
  246. reloading = false
  247. local medta = {"9105156322","9105157537","9105158278"}
  248. function medic()
  249. reloading = true
  250. local billboard = Instance.new("BillboardGui", owner.Character.Head)
  251. billboard.Size = UDim2.new(2,0,2,0)
  252. local frame = Instance.new("ImageLabel", billboard)
  253. local tweenService = game:GetService("TweenService")
  254. local timeToFade = 0.125
  255. local object = billboard
  256. local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Linear)
  257. local goal = {}
  258. goal.StudsOffset = Vector3.new(0, 2.5, 0)
  259. local tween = tweenService:Create(object, tweenInfo, goal)
  260. tween:Play()
  261. frame.BackgroundTransparency = 1
  262. frame.ImageTransparency = 1
  263. frame.Image = "http://www.roblox.com/asset/?id=2807917209"
  264. frame.Size = UDim2.new(1,0,1,0)
  265. local tweenService = game:GetService("TweenService")
  266. local timeToFade = 0.125
  267. local object = frame
  268. local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Linear)
  269. local goal = {}
  270. goal.ImageTransparency = 0
  271. local tween = tweenService:Create(object, tweenInfo, goal)
  272. tween:Play()
  273. game:GetService("Debris"):AddItem(billboard,2)
  274. reloading = true
  275. tween15:Play()
  276. tween16:Play()
  277. medicl.Parent = owner.Character.Head
  278. medicl.SoundId = "rbxassetid://"..medta[math.random(1,3)]
  279. medicl:Play()
  280. medicl.Ended:Wait()
  281. medicl.Parent = nil
  282. tween12:Play()
  283. tween13:Play()
  284. tween12.Completed:Wait()
  285. reloading = false
  286. end
  287. function reload()
  288. reloading = true
  289. ammo = 0
  290. active = false
  291. tween:Cancel()
  292. tween2:Cancel()
  293. tween3:Cancel()
  294. tween4:Cancel()
  295. weld2.C0 = CFrame.Angles(math.rad(-80),math.rad(65),0) * CFrame.new(0.25,-0.35,1.75)
  296. weld3.C0 = CFrame.Angles(math.rad(-90),math.rad(-15),0) * CFrame.new(-1,-0.45,1)
  297. tween9:Play()
  298. tween9.Completed:Wait()
  299. local cfr = owner.Character["Left Arm"].CFrame:Inverse() * drum.CFrame
  300. weld.Parent = owner.Character["Left Arm"]
  301. weld.Part1 = owner.Character["Left Arm"]
  302. task.wait()
  303. weld.C0 = cfr:Inverse()
  304. task.wait()
  305. tween11:Play()
  306. tween11.Completed:Wait()
  307. tween12:Play()
  308. tween13:Play()
  309. tween12.Completed:Wait()
  310. weld.Parent = nailgun
  311. weld.Part1 = nailgun
  312. task.wait()
  313. weld.C0 = CFrame.new(0,0.425,0.275)
  314. task.wait()
  315. ammo = 100
  316. tween:Play()
  317. tween2:Play()
  318. reloading = false
  319. end
  320. local reloading = false
  321. local firing = false
  322. function shoot()
  323. nailg.Parent = nailgun
  324. nailg.PlaybackSpeed = 2
  325. nailg.SoundId = s1
  326. nailg.Parent = nil
  327. firing = true
  328. tween5:Play()
  329. tween6:Play()
  330. coroutine.wrap(function()
  331. for i = 1, 6 do
  332. wait(0.0125)
  333. local Flame3 = Instance.new("SpawnLocation", script)
  334. Flame3.Size = Vector3.new(0.25,0.25,0.25)
  335. Flame3.Neutral = false
  336. Flame3.Enabled = false
  337. Flame3.CFrame = nailgun.CFrame * CFrame.new(0,0.65,-1)
  338. Flame3.Position = Flame3.Position + Vector3.new(nailgun.Velocity.X * owner:GetNetworkPing() * 12,nailgun.Velocity.Y * owner:GetNetworkPing() * 12,nailgun.Velocity.Z * owner:GetNetworkPing() * 12)
  339. Flame3.CanCollide = false
  340. Flame3.CanTouch = false
  341. Flame3.Color = Color3.fromRGB(255, 50, 50)
  342. Flame3.Material = "Neon"
  343. Flame3.Anchored = true
  344. Flame3.Name = "Flameslol"
  345. game:GetService("Debris"):AddItem(Flame3,0.0625)
  346. local timeToFade6 = 0.0625
  347. local object6 = Flame3
  348. local tweenInfo6 = TweenInfo.new(timeToFade6)
  349. local goal10 = {}
  350. goal10.CFrame = Flame3.CFrame * CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360)))
  351. goal10.Transparency = 1
  352. goal10.Color = Color3.fromRGB(255, 155, 0)
  353. local tween10 = tweenService:Create(object6, tweenInfo6, goal10)
  354. tween10:Play()
  355. end
  356. end)()
  357. local Flame3 = Instance.new("SpawnLocation", script)
  358. Flame3.Size = Vector3.new(0.25,0.25,0.25)
  359. Flame3.Neutral = false
  360. Flame3.Enabled = false
  361. Flame3.CFrame = nailgun.CFrame * CFrame.new(0,0.65,-1)
  362. Flame3.Position = Flame3.Position + Vector3.new(nailgun.Velocity.X * owner:GetNetworkPing() * 12,nailgun.Velocity.Y * owner:GetNetworkPing() * 12,nailgun.Velocity.Z * owner:GetNetworkPing() * 12)
  363. Flame3.CanCollide = false
  364. Flame3.Color = Color3.fromRGB(255, 50, 50)
  365. Flame3.Material = "Neon"
  366. Flame3.Anchored = true
  367. Flame3.Name = "Flameslol"
  368. game:GetService("Debris"):AddItem(Flame3,0.0625)
  369. local timeToFade6 = 0.0625
  370. local object6 = Flame3
  371. local tweenInfo6 = TweenInfo.new(timeToFade6)
  372. local goal10 = {}
  373. goal10.CFrame = Flame3.CFrame * CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360)))
  374. goal10.Transparency = 1
  375. goal10.Color = Color3.fromRGB(255, 155, 0)
  376. local tween10 = tweenService:Create(object6, tweenInfo6, goal10)
  377. tween10:Play()
  378. tween10.Completed:Wait()
  379. tween7:Play()
  380. tween8:Play()
  381. firing = false
  382. if not active then
  383. tween8.Completed:Wait()
  384. tween:Play()
  385. tween2:Play()
  386. end
  387. end
  388. e.OnServerEvent:Connect(function(_,action,hitp)
  389. if action == "fire" and ammo > 0 and not reloading and toolout then
  390. ammo -= 1
  391. shoot()
  392. local nail = Instance.new("SpawnLocation",script)
  393. nail.Enabled = false
  394. nail.CanCollide = false
  395. nail.Name = "nails?!"
  396. nail.Size = Vector3.new(0.2541875, 0.759,0.2541875)
  397. nail.CFrame = nailgun.CFrame * CFrame.new(0,0.7,-2.5)
  398. nail.Position = nail.Position + Vector3.new(nailgun.Velocity.X * owner:GetNetworkPing() * 12,nailgun.Velocity.Y * owner:GetNetworkPing() * 12,nailgun.Velocity.Z * owner:GetNetworkPing() * 12)
  399. nail.CFrame = CFrame.new(nail.Position) * CFrame.Angles(CFrame.new(hitp.Position,nail.Position):ToEulerAnglesXYZ()) * CFrame.Angles(math.rad(Random.new():NextNumber(-0.5,0.5)),math.rad(Random.new():NextNumber(-0.5,0.5)),math.rad(Random.new():NextNumber(-0.5,0.5))) * CFrame.Angles(math.rad(-90),0,0)
  400. local forks = Instance.new("BodyVelocity",nail)
  401. forks.MaxForce = Vector3.new(0,math.huge,0)
  402. forks.Velocity = Vector3.new(0,0,0)
  403. forks.Name = "usedaforks"
  404. local tweenService = game:GetService("TweenService")
  405. local timeToFade = 7.5
  406. local object = nail
  407. local tweenInfo = TweenInfo.new(timeToFade)
  408. local goal = {}
  409. goal.CFrame = nail.CFrame * CFrame.new(0,-500,0)
  410.  
  411. local tween = tweenService:Create(object, tweenInfo, goal)
  412. tween:Play()
  413. game:GetService("Debris"):AddItem(nail,20)
  414. nailm = Instance.new("SpecialMesh")
  415. nailm.Parent = nail
  416. nailm.MeshId = "http://www.roblox.com/asset/?id=6742739474"
  417. nailm.Scale = Vector3.new(0.03125, 0.0625, 0.03125)
  418. local tr = Instance.new("Trail",nail)
  419. nail.Touched:Connect(function(parth)
  420. if parth.Name ~= "nails?!" then
  421. tween:Cancel()
  422. tr.Enabled = false
  423. if not nail:FindFirstChild("the") then
  424. if nail:FindFirstChild("usedaforks") then
  425. nail:FindFirstChild("usedaforks"):Destroy()
  426. end
  427. local weldconst = Instance.new("WeldConstraint",nail)
  428. weldconst.Name = "the"
  429. weldconst.Part1 = parth
  430. weldconst.Part0 = nail
  431. local humanoid = parth.Parent:FindFirstChild("Humanoid") or parth.Parent.Parent:FindFirstChild("Humanoid")
  432. if humanoid then
  433. if not table.find(dmgd,humanoid) then
  434. humanoid.Health = humanoid.Health - dmg
  435. else
  436. humanoid.Health = humanoid.Health - dmg * 2
  437. end
  438. end
  439. end
  440. end
  441. return
  442. end)
  443. local attach1 = Instance.new("Attachment", nail)
  444. local attach2 = Instance.new("Attachment", nail)
  445. attach1.CFrame = CFrame.new(0,0,0.125)
  446. attach2.CFrame = CFrame.new(0,0,-0.125)
  447. tr.Attachment0 = attach1
  448. tr.Attachment1 = attach2
  449. tr.LightInfluence = 1
  450. if owner.Team == nil and owner.Neutral then
  451. local App = game:GetService("Players"):GetCharacterAppearanceAsync(owner.UserId)
  452. local col = App["Body Colors"].TorsoColor
  453. tr.Color = ColorSequence.new{ColorSequenceKeypoint.new(0,col.Color),ColorSequenceKeypoint.new(1,col.Color)}
  454. else
  455. local col = owner.TeamColor
  456. tr.Color = ColorSequence.new{ColorSequenceKeypoint.new(0,col),ColorSequenceKeypoint.new(1,col)}
  457. end
  458. tr.Transparency = NumberSequence.new(0.8125,1)
  459. tr.Lifetime = 0.185
  460. tr.WidthScale = NumberSequence.new{NumberSequenceKeypoint.new(0, 1),NumberSequenceKeypoint.new(1, 0)}
  461. tr.FaceCamera = true
  462. elseif action == "reload" and not reloading and not firing and toolout then
  463. nailg.Parent = nailgun
  464. nailg.PlaybackSpeed = 2
  465. nailg.SoundId = s2
  466. nailg.Parent = nil
  467. reload()
  468. elseif action == "medic" and not reloading and not firing and toolout then
  469. medic()
  470. elseif action == "milmk" and not reloading and not firing and toolout then
  471. tween11:Play()
  472. reloading = true
  473. coroutine.wrap(function()
  474. wait(10)
  475. if reloading then
  476. reloading = false
  477. end
  478. end)()
  479. tween11.Completed:Wait()
  480. local milk = Instance.new("SpawnLocation",script)
  481. milk.Enabled = false
  482. milk.Size = Vector3.new(0.367, 0.367,0.367)
  483. milk.Color = Color3.fromRGB(252, 247, 217)
  484. milkm = Instance.new("SpecialMesh")
  485. milkm.Parent = milk
  486. milkm.MeshId = "http://www.roblox.com/asset/?id=7783530621"
  487. milkm.TextureId = ""
  488. milkm.Scale = Vector3.new(1,1,1)
  489. local milk2 = Instance.new("SpawnLocation",script)
  490. milk2.Enabled = false
  491. milk2.Size = Vector3.new(1, 1,1)
  492. milk2.Transparency = 0.5
  493. milkm2 = Instance.new("SpecialMesh")
  494. milkm2.Parent = milk2
  495. milkm2.MeshId = "http://www.roblox.com/asset/?id=7783530779"
  496. milkm2.Scale = Vector3.new(1,1,1)
  497. milk2.CanTouch = false
  498. milk2.CanCollide = false
  499. local weld = Instance.new("Weld",milk)
  500. weld.Part0 = milk2
  501. weld.Part1 = milk
  502. local weld2 = Instance.new("Weld",owner.Character["Left Arm"])
  503. weld2.Part0 = milk
  504. weld2.Part1 = owner.Character["Left Arm"]
  505. weld2.C0 = CFrame.new(0,1.125,0)
  506. tween17:Play()
  507. tween17.Completed:Wait()
  508. tween18:Play()
  509. tween18.Completed:Wait()
  510. weld2:Destroy()
  511. wait()
  512. tween12:Play()
  513. local attachment = Instance.new("Attachment",milk)
  514. attachment.CFrame = CFrame.new(0,0,-0.4375)
  515. local pe2 = Instance.new("ParticleEmitter", attachment)
  516. pe2.Color = ColorSequence.new(Color3.fromRGB(252, 247, 217))
  517. pe2.LightEmission = 0
  518. pe2.LightInfluence = 1
  519. pe2.EmissionDirection = "Front"
  520. pe2.Orientation = Enum.ParticleOrientation.VelocityParallel
  521. pe2.Size = NumberSequence.new(0.35,0)
  522. pe2.Texture = "rbxassetid://243132757"
  523. pe2.Transparency = NumberSequence.new(0,1)
  524. pe2.Lifetime = NumberRange.new(4,6)
  525. pe2.Rate = 200
  526. pe2.Rotation = NumberRange.new(90)
  527. pe2.RotSpeed = NumberRange.new(0)
  528. pe2.Speed = NumberRange.new(10)
  529. pe2.SpreadAngle = Vector2.new(-55,55)
  530. pe2.Drag = NumberRange.new(1)
  531. pe2.Acceleration = Vector3.new(math.random(-10,10),-35,math.random(-10,10))
  532. local t = 0.5
  533. local g = Vector3.new(0, -game.Workspace.Gravity, 0);
  534. local x0 = milk.CFrame
  535. local v0 = (Vector3.new(50,50,50) * (hitp.Position - x0.Position).Unit - 0.5*g*t*t)/t;
  536. local nt = 0;
  537. local rs = game:GetService("RunService").Heartbeat
  538. local nt = 0
  539. local forks = Instance.new("BodyVelocity",milk)
  540. forks.MaxForce = Vector3.new(0,math.huge,0)
  541. forks.Velocity = Vector3.new(0,0,0)
  542. coroutine.wrap(function()
  543. while (nt < t*4) do
  544. milk.CFrame = CFrame.new(0.5*g*nt*nt + v0*nt + x0.Position) * CFrame.Angles(math.rad(360 * math.pi * nt),math.rad(-360 * math.pi * nt),math.rad(360 * math.pi * nt));
  545. nt = nt + rs:Wait()
  546. end
  547. end)()
  548. wait(0.25)
  549. milk.Touched:Connect(function()
  550. nt = 2
  551. reloading = false
  552. local pard = Instance.new("Part",script)
  553. pard.Anchored = true
  554. pard.Position = milk.Position
  555. pard.CanCollide = false
  556. pard.CanTouch = false
  557. pard.Transparency = 1
  558. pard.Size = Vector3.new(0.05,0.05,0.05)
  559. local explosion = Instance.new("Explosion")
  560. explosion.Visible = false
  561. explosion.BlastPressure = 0
  562. explosion.DestroyJointRadiusPercent = 0
  563. explosion.BlastRadius = 15
  564. local pe = Instance.new("ParticleEmitter", pard)
  565. pe.Color = ColorSequence.new(Color3.fromRGB(252, 247, 217))
  566. pe.LightEmission = 0
  567. pe.LightInfluence = 1
  568. pe.EmissionDirection = "Top"
  569. pe.Orientation = Enum.ParticleOrientation.VelocityParallel
  570. pe.Size = NumberSequence.new(0.35,0)
  571. pe.Texture = "rbxassetid://243132757"
  572. pe.Transparency = NumberSequence.new(0,1)
  573. pe.Lifetime = NumberRange.new(1,2)
  574. pe.Rate = 200
  575. pe.Rotation = NumberRange.new(90)
  576. pe.RotSpeed = NumberRange.new(0)
  577. pe.Speed = NumberRange.new(20)
  578. pe.SpreadAngle = Vector2.new(-35,35)
  579. pe.Drag = NumberRange.new(1)
  580. pe.Acceleration = Vector3.new(math.random(-10,10),-35,math.random(-10,10))
  581. coroutine.wrap(function()
  582. wait(0.25)
  583. pe.Enabled = false
  584. end)()
  585. local billboard = Instance.new("BillboardGui", pard)
  586. billboard.Size = UDim2.new(0.125,0,0.125,0)
  587. local frame = Instance.new("ImageLabel", billboard)
  588. frame.BackgroundTransparency = 1
  589. frame.ImageTransparency = 0.25
  590. frame.Image = "http://www.roblox.com/asset/?id=7833576267"
  591. frame.Size = UDim2.new(1,0,1,0)
  592. frame.ImageColor3 = Color3.fromRGB(252, 247, 217)
  593. local tweenService = game:GetService("TweenService")
  594. local timeToFade = 0.25
  595. local object = billboard
  596. local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Linear)
  597. local goal = {}
  598. goal.Size = UDim2.new(5,0,5,0)
  599. local tween = tweenService:Create(object, tweenInfo, goal)
  600. local goal2 = {}
  601. goal2.ImageTransparency = 1
  602. local tween2 = tweenService:Create(frame, tweenInfo, goal2)
  603. tween:Play()
  604. tween2:Play()
  605. game:GetService("Debris"):AddItem(billboard,0.25)
  606. game:GetService("Debris"):AddItem(pard,2.5)
  607. nailg.Parent = milk
  608. nailg.SoundId = "rbxassetid://8078087229"
  609. nailg.PlaybackSpeed = 1
  610. nailg.Parent = nil
  611. milk:Destroy()
  612. milk2:Destroy()
  613. explosion.Position = pard.Position
  614. explosion.Parent = pard
  615. explosion.Hit:Connect(function(part, distance)
  616. local humanoid = part.Parent:FindFirstChildWhichIsA("Humanoid") or part.Parent.Parent:FindFirstChildWhichIsA("Humanoid")
  617. if humanoid and not table.find(c,humanoid) then
  618. table.insert(c,humanoid)
  619. table.insert(dmgd,humanoid)
  620. local distanceFactor = distance / explosion.BlastRadius
  621. distanceFactor = 1 - distanceFactor
  622. local time = math.clamp(20 * distanceFactor,5,20)
  623. coroutine.wrap(function()
  624. for i,v in pairs(humanoid.Parent:GetDescendants()) do
  625. coroutine.wrap(function()
  626. if v:IsA("SpecialMesh") then
  627. coroutine.wrap(function()
  628. local td = v.TextureId
  629. task.wait()
  630. v.TextureId = ""
  631. local decal = Instance.new("Texture",v.Parent)
  632. decal.StudsPerTileU = v.Parent.Size.X
  633. decal.StudsPerTileV = v.Parent.Size.Y
  634. decal.Face = "Front"
  635. decal.Texture = td
  636. decal.Transparency = 0.85
  637. game:GetService("Debris"):AddItem(decal,time)
  638. local tweenService = game:GetService("TweenService")
  639. local timeToFade = time
  640. local object = decal
  641. local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Linear)
  642. local goal = {}
  643. goal.Transparency = 0
  644. local tween = tweenService:Create(object, tweenInfo, goal)
  645. tween:Play()
  646. tween.Completed:Wait()
  647. v.TextureId = td
  648. table.remove(dmgd,table.find(dmgd,humanoid))
  649. table.remove(c,table.find(c,humanoid))
  650. end)()
  651. elseif v:IsA("Clothing") then
  652. local tweenService = game:GetService("TweenService")
  653. local timeToFade = time
  654. local object = v
  655. local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Linear)
  656. local goal = {}
  657. goal.Color3 = v.Color3
  658. local tween = tweenService:Create(object, tweenInfo, goal)
  659. task.wait()
  660. local r = (252 / 255) / 5
  661. local g = (247 / 255) / 5
  662. local b = (217 / 255) / 5
  663. v.Color3 = Color3.new(r,g,b)
  664. task.wait()
  665. tween:Play()
  666. elseif v:IsA("BasePart") then
  667. local tweenService = game:GetService("TweenService")
  668. local timeToFade = time
  669. local object = v
  670. local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Linear)
  671. local goal = {}
  672. goal.Color = v.Color
  673. local tween = tweenService:Create(object, tweenInfo, goal)
  674. task.wait()
  675. local avg = (53/255) / 3
  676. local r = ((252 / 255) + avg) / 1.25
  677. local g = ((247 / 255) + avg) / 1.25
  678. local b = ((217 / 255) + avg) / 1.25
  679. v.Color = Color3.new(r,g,b)
  680. task.wait()
  681. tween:Play()
  682. end
  683. end)()
  684. end
  685. end)()
  686. end
  687. end)
  688. end)
  689. end
  690. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement