RobloxScripty

Untitled

Jul 5th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.92 KB | None | 0 0
  1. --[[
  2. Military Gas Mask
  3. Protects the lungs from harmful things in the air by filtering them out.
  4. Style 1: Single filter, forward.
  5. Style 2: Single filter, left.
  6. Style 3: Single filter, right.
  7. Style 4: Dual filter.
  8. Style 5: Triple filter.
  9. --]]
  10.  
  11.  
  12. Style = 1
  13.  
  14.  
  15. function GiveHat(Player)
  16. local Hat = Instance.new("Hat")
  17. Hat.Name = "Gas Mask"
  18. Hat.AttachmentPos = Vector3.new(0, 0.5, -0.1)
  19.  
  20. local MasterPart = Instance.new("Part", Hat)
  21. MasterPart.Name = "Handle"
  22. MasterPart.TopSurface = 0
  23. MasterPart.BottomSurface = 0
  24. MasterPart.BrickColor = BrickColor.new("Really black")
  25. MasterPart.FormFactor = "Custom"
  26. MasterPart.Size = Vector3.new(1.3, 1.3, 1.3)
  27. Instance.new("SpecialMesh", MasterPart).MeshType = "Head"
  28.  
  29. local Part = Instance.new("Part", Hat)
  30. Part.Name = "Glass"
  31. Part.TopSurface = 0
  32. Part.BottomSurface = 0
  33. Part.Transparency = 0.5
  34. Part.BrickColor = BrickColor.new("Institutional white")
  35. Part.FormFactor = "Custom"
  36. Part.Size = Vector3.new(1.15, 1.15, 1.15)
  37. Instance.new("SpecialMesh", Part).MeshType = "Head"
  38. local Weld = Instance.new("Weld")
  39. Weld.Part0 = Part
  40. Weld.Part1 = MasterPart
  41. Weld.C0 = CFrame.new(0, 0, 0.2)
  42. Weld.Parent = Weld.Part0
  43.  
  44. local Part = Instance.new("Part", Hat)
  45. Part.Name = "Cover"
  46. Part.TopSurface = 0
  47. Part.BottomSurface = 0
  48. Part.BrickColor = BrickColor.new("Really black")
  49. Part.FormFactor = "Custom"
  50. Part.Size = Vector3.new(1.15, 0.65, 1.15)
  51. Instance.new("CylinderMesh", Part)
  52. local Weld = Instance.new("Weld")
  53. Weld.Part0 = Part
  54. Weld.Part1 = MasterPart
  55. Weld.C0 = CFrame.new(0, 0.255, 0.225)
  56. Weld.Parent = Weld.Part0
  57.  
  58. if Style == 1 or Style == 5 then
  59. local Part = Instance.new("Part", Hat)
  60. Part.Name = "Filter Holder"
  61. Part.TopSurface = 0
  62. Part.BottomSurface = 0
  63. Part.BrickColor = BrickColor.new("Really black")
  64. Part.FormFactor = "Custom"
  65. Part.Size = Vector3.new(0.4, 0.3, 0.4)
  66. Instance.new("CylinderMesh", Part)
  67. local Weld = Instance.new("Weld")
  68. Weld.Part0 = Part
  69. Weld.Part1 = MasterPart
  70. Weld.C0 = CFrame.new(0, -0.85, 0.05) * CFrame.fromEulerAnglesXYZ(math.rad(105), 0, 0)
  71. Weld.Parent = Weld.Part0
  72.  
  73. local Part = Instance.new("Part", Hat)
  74. Part.Name = "Filter"
  75. Part.TopSurface = 0
  76. Part.BottomSurface = 0
  77. Part.BrickColor = BrickColor.new("Grime")
  78. Part.FormFactor = "Custom"
  79. Part.Size = Vector3.new(0.7, 0.5, 0.7)
  80. Instance.new("CylinderMesh", Part).Bevel = 0.05
  81. local Weld = Instance.new("Weld")
  82. Weld.Part0 = Part
  83. Weld.Part1 = MasterPart
  84. Weld.C0 = CFrame.new(0, -1.25, 0.05) * CFrame.fromEulerAnglesXYZ(math.rad(105), 0, 0)
  85. Weld.Parent = Weld.Part0
  86. end
  87.  
  88. if Style == 2 or Style == 4 or Style == 5 then
  89. local Part = Instance.new("Part", Hat)
  90. Part.Name = "Filter Holder Left"
  91. Part.TopSurface = 0
  92. Part.BottomSurface = 0
  93. Part.BrickColor = BrickColor.new("Really black")
  94. Part.FormFactor = "Custom"
  95. Part.Size = Vector3.new(0.4, 0.3, 0.4)
  96. Instance.new("CylinderMesh", Part)
  97. local Weld = Instance.new("Weld")
  98. Weld.Part0 = Part
  99. Weld.Part1 = MasterPart
  100. Weld.C0 = CFrame.new(0, -0.85, 0.05) * CFrame.fromEulerAnglesXYZ(math.rad(105), math.rad(30), 0)
  101. Weld.Parent = Weld.Part0
  102.  
  103. local Part = Instance.new("Part", Hat)
  104. Part.Name = "Filter Left"
  105. Part.TopSurface = 0
  106. Part.BottomSurface = 0
  107. Part.BrickColor = BrickColor.new("Grime")
  108. Part.FormFactor = "Custom"
  109. Part.Size = Vector3.new(0.6, 0.3, 0.6)
  110. Instance.new("CylinderMesh", Part).Bevel = 0.05
  111. local Weld = Instance.new("Weld")
  112. Weld.Part0 = Part
  113. Weld.Part1 = MasterPart
  114. Weld.C0 = CFrame.new(0, -1.15, 0.05) * CFrame.fromEulerAnglesXYZ(math.rad(105), math.rad(30), 0)
  115. Weld.Parent = Weld.Part0
  116. end
  117.  
  118. if Style == 3 or Style == 4 or Style == 5 then
  119. local Part = Instance.new("Part", Hat)
  120. Part.Name = "Filter Holder Right"
  121. Part.TopSurface = 0
  122. Part.BottomSurface = 0
  123. Part.BrickColor = BrickColor.new("Really black")
  124. Part.FormFactor = "Custom"
  125. Part.Size = Vector3.new(0.4, 0.3, 0.4)
  126. Instance.new("CylinderMesh", Part)
  127. local Weld = Instance.new("Weld")
  128. Weld.Part0 = Part
  129. Weld.Part1 = MasterPart
  130. Weld.C0 = CFrame.new(0, -0.85, 0.05) * CFrame.fromEulerAnglesXYZ(math.rad(105), math.rad(-30), 0)
  131. Weld.Parent = Weld.Part0
  132.  
  133. local Part = Instance.new("Part", Hat)
  134. Part.Name = "Filter Right"
  135. Part.TopSurface = 0
  136. Part.BottomSurface = 0
  137. Part.BrickColor = BrickColor.new("Grime")
  138. Part.FormFactor = "Custom"
  139. Part.Size = Vector3.new(0.6, 0.3, 0.6)
  140. Instance.new("CylinderMesh", Part).Bevel = 0.05
  141. local Weld = Instance.new("Weld")
  142. Weld.Part0 = Part
  143. Weld.Part1 = MasterPart
  144. Weld.C0 = CFrame.new(0, -1.15, 0.05) * CFrame.fromEulerAnglesXYZ(math.rad(105), math.rad(-30), 0)
  145. Weld.Parent = Weld.Part0
  146. end
  147.  
  148. for _, Part in pairs(Hat:GetChildren()) do
  149. Part.CanCollide = false
  150. Part.Locked = true
  151. if Part:FindFirstChild("Weld") ~= nil then
  152. local Fixing = false
  153. local Joint = Part.Weld:Clone()
  154. Part.ChildRemoved:connect(function()
  155. if Fixing == false then
  156. Fixing = true
  157. Part:BreakJoints()
  158. wait()
  159. Joint.Part0.CFrame = Joint.Part1.CFrame * Joint.C1 * Joint.C0:inverse()
  160. local NewJoint = Joint:Clone()
  161. NewJoint.Parent = Part
  162. Part:MakeJoints()
  163. Fixing = false
  164. end
  165. end)
  166. end
  167. end
  168.  
  169. Hat.AncestryChanged:connect(function(Property)
  170. local Breathing = true
  171. coroutine.wrap(function()
  172. while true do
  173. if Hat.Parent == nil then break end
  174. if Hat.Parent:FindFirstChild("Humanoid") == nil then break end
  175. if Hat.Parent.Humanoid.Health <= 0 then break end
  176. wait()
  177. end
  178. Breathing = false
  179. end)()
  180. local Sound1 = Instance.new("Sound", Hat.Handle)
  181. Sound1.Name = "Hiss 1"
  182. Sound1.SoundId = "rbxasset://sounds/hit.wav"
  183. Sound1.Pitch = 5
  184. Sound1.Looped = true
  185. local Sound2 = Instance.new("Sound", Hat.Handle)
  186. Sound2.Name = "Hiss 2"
  187. Sound2.SoundId = "rbxasset://sounds/hit.wav"
  188. Sound2.Pitch = 5
  189. Sound2.Looped = true
  190. wait(0.1)
  191. while Breathing == true do
  192. Sound1.Pitch = 9
  193. Sound2.Pitch = 8
  194. Sound1:Play()
  195. Sound2:Play()
  196. for i = 0, 0.1, 0.0025 do
  197. if Breathing == false then break end
  198. Sound1.Volume = i
  199. Sound2.Volume = i
  200. wait()
  201. end
  202. Sound1:Stop()
  203. Sound2:Stop()
  204. wait(0.25)
  205. Sound1.Pitch = 6.5
  206. Sound2.Pitch = 7.5
  207. Sound1:Play()
  208. Sound2:Play()
  209. for i = 0.1, 0, -0.0025 do
  210. if Breathing == false then break end
  211. Sound1.Volume = i
  212. Sound2.Volume = i
  213. wait()
  214. end
  215. Sound1:Stop()
  216. Sound2:Stop()
  217. wait(0.5)
  218. end
  219. Sound1:Stop()
  220. Sound2:Stop()
  221. wait(0.1)
  222. Sound1:Remove()
  223. Sound2:Remove()
  224. end)
  225.  
  226. Hat.Parent = Player.Character
  227. end
  228.  
  229.  
  230. GiveHat(script:FindFirstChild("Player") ~= nil and script.Player.Value or game:GetService("Players"):FindFirstChild("DarkShadow6"))
  231. --[[
  232. while true do
  233. for _, Player in pairs(game:GetService("Players"):GetPlayers()) do
  234. pcall(function()
  235. Player.Character["Gas Mask"]:Remove()
  236. end)
  237. pcall(function()
  238. GiveHat(Player)
  239. end)
  240. end
  241. wait(0.1)
  242. end
  243. --]]
Add Comment
Please, Sign In to add comment