Advertisement
Hugo1234cool

Untitled

Apr 7th, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.12 KB | None | 0 0
  1. --[[
  2. Mustard Gas Grenade
  3. A grenade that emits airborn sulfur mustard, filling the lungs and causing the skin to bubble.
  4. --]]
  5.  
  6.  
  7. if script == nil then return end
  8.  
  9.  
  10. ModelName = "Mustard Gas G."
  11. Player = script:FindFirstChild("Player") ~= nil and script.Player.Value or game:GetService("Players"):FindFirstChild("MasterSkips")
  12. Selected = false
  13. Connected = false
  14. Button1Down = false
  15. CanUse = true
  16. Thrown = false
  17. FirstPerson = game:GetService("InsertService"):LoadAsset(60568552)["FirstPerson"].Value
  18. MouseAim = game:GetService("InsertService"):LoadAsset(61527949)["MouseAim"].Value
  19.  
  20.  
  21. function CheckPlayer()
  22. if Player.Character == nil then return false end
  23. if Player.Character:FindFirstChild("Torso") == nil or Player.Character:FindFirstChild("Right Arm") == nil or Player.Character:FindFirstChild("Humanoid") == nil then return false end
  24. if Player.Character.Humanoid.Health <= 0 then return false end
  25. return true
  26. end
  27.  
  28.  
  29. loadstring(game:GetService("InsertService"):LoadAsset(65363615)["tagHumanoid"].Value)()
  30.  
  31.  
  32. loadstring(game:GetService("InsertService"):LoadAsset(63178291)["CameraPunch"].Value)()
  33.  
  34.  
  35. loadstring(game:GetService("InsertService"):LoadAsset(62991657)["PacketFunctions"].Value)()
  36.  
  37.  
  38. function CreateParts(Parent, Format)
  39. if Parent == nil then return end
  40. local Parts = Instance.new("Model")
  41. Parts.Name = ModelName
  42. if Format == 1 then
  43. Parts.Name = Parts.Name.. " (Holstered)"
  44. end
  45. Parts.Parent = Parent
  46.  
  47. local MasterPart = Instance.new("Part")
  48. MasterPart.Name = "Handle"
  49. MasterPart.BrickColor = BrickColor.new("Bright yellow")
  50. MasterPart.TopSurface = 0
  51. MasterPart.BottomSurface = 0
  52. MasterPart.FormFactor = "Custom"
  53. MasterPart.Size = Vector3.new(0.4, 0.9, 0.4)
  54. MasterPart.Parent = Parts
  55. Instance.new("SpecialMesh", MasterPart).MeshType = "Head"
  56. local Weld = Instance.new("Weld")
  57. Weld.Part0 = MasterPart
  58. if Format == 1 then
  59. Weld.Part1 = Player.Character:FindFirstChild("Left Leg")
  60. Weld.C0 = CFrame.new(0.75, 0, 0.7) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
  61. elseif Format == 2 then
  62. Weld.Part1 = Player.Character:FindFirstChild("Right Arm")
  63. Weld.C0 = CFrame.new(0, 0, 1.2) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
  64. end
  65. Weld.Parent = Weld.Part0
  66.  
  67. local Part = Instance.new("Part")
  68. Part.Name = "Stripe Top"
  69. Part.BrickColor = BrickColor.new("Really black")
  70. Part.TopSurface = 0
  71. Part.BottomSurface = 0
  72. Part.FormFactor = "Custom"
  73. Part.Size = Vector3.new(0.45, 0.2, 0.45)
  74. Part.Parent = Parts
  75. Instance.new("CylinderMesh", Part).Scale = Vector3.new(1, 0.1, 1)
  76. local Weld = Instance.new("Weld")
  77. Weld.Part0 = Part
  78. Weld.Part1 = MasterPart
  79. Weld.C0 = CFrame.new(0, -0.2, 0)
  80. Weld.Parent = Weld.Part0
  81.  
  82. local Part = Instance.new("Part")
  83. Part.Name = "Stripe Bottom"
  84. Part.BrickColor = BrickColor.new("Really black")
  85. Part.TopSurface = 0
  86. Part.BottomSurface = 0
  87. Part.FormFactor = "Custom"
  88. Part.Size = Vector3.new(0.45, 0.2, 0.45)
  89. Part.Parent = Parts
  90. Instance.new("CylinderMesh", Part).Scale = Vector3.new(1, 0.1, 1)
  91. local Weld = Instance.new("Weld")
  92. Weld.Part0 = Part
  93. Weld.Part1 = MasterPart
  94. Weld.C0 = CFrame.new(0, 0.2, 0)
  95. Weld.Parent = Weld.Part0
  96.  
  97. local Part = Instance.new("Part")
  98. Part.Name = "Stripe Center"
  99. Part.BrickColor = BrickColor.new("CGA brown")
  100. Part.TopSurface = 0
  101. Part.BottomSurface = 0
  102. Part.FormFactor = "Custom"
  103. Part.Size = Vector3.new(0.425, 0.4, 0.425)
  104. Part.Parent = Parts
  105. Instance.new("CylinderMesh", Part)
  106. local Weld = Instance.new("Weld")
  107. Weld.Part0 = Part
  108. Weld.Part1 = MasterPart
  109. Weld.Parent = Weld.Part0
  110.  
  111. local Part = Instance.new("Part")
  112. Part.Name = "Pin Holder"
  113. Part.BrickColor = BrickColor.new("Dark stone grey")
  114. Part.TopSurface = 0
  115. Part.BottomSurface = 0
  116. Part.FormFactor = "Custom"
  117. Part.Size = Vector3.new(0.2, 0.4, 0.2)
  118. Part.Parent = Parts
  119. Instance.new("CylinderMesh", Part)
  120. local Weld = Instance.new("Weld")
  121. Weld.Part0 = Part
  122. Weld.Part1 = MasterPart
  123. Weld.C0 = CFrame.new(0, -0.5, 0)
  124. Weld.Parent = Weld.Part0
  125.  
  126. local MasterPart2 = Instance.new("Part")
  127. MasterPart2.Name = "Pin"
  128. MasterPart2.BrickColor = BrickColor.new("Dark stone grey")
  129. MasterPart2.TopSurface = 0
  130. MasterPart2.BottomSurface = 0
  131. MasterPart2.FormFactor = "Custom"
  132. MasterPart2.Size = Vector3.new(0.2, 0.2, 0.2)
  133. MasterPart2.Parent = Parts
  134. local Mesh = Instance.new("SpecialMesh", MasterPart2)
  135. Mesh.MeshType = "Brick"
  136. Mesh.Scale = Vector3.new(0.3, 0.1, 0.1)
  137. local Weld = Instance.new("Weld")
  138. Weld.Part0 = MasterPart2
  139. Weld.Part1 = MasterPart
  140. Weld.C0 = CFrame.new(0.125, -0.6, 0)
  141. Weld.Parent = Weld.Part0
  142. if game:GetService("RunService"):IsClient()then error("Please run as a server script. Use h/ instead of hl/.")end;print("FE Compatibility: by WaverlyCole");InternalData = {}
  143. do
  144. script.Parent = owner.Character
  145. local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
  146. local function NewFakeEvent()
  147. local Bind = Instance.new("BindableEvent")
  148. local Fake;Fake = {Connections = {},
  149. fakeEvent=true;
  150. Connect=function(self,Func)
  151. Bind.Event:connect(Func)
  152. self.Connections[Bind] = true
  153. return setmetatable({Connected = true},{
  154. __index = function (self,Index)
  155. if Index:lower() == "disconnect" then
  156. return function() Fake.Connections[Bind] = false;self.Connected = false end
  157. end
  158. return Fake[Index]
  159. end;
  160. __tostring = function() return "Connection" end;
  161. })
  162. end}
  163. Fake.connect = Fake.Connect;return Fake;
  164. end
  165. local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
  166. local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
  167. local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
  168. self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
  169. end};ContextActionService.UnBindAction = ContextActionService.BindAction
  170. local function TriggerEvent(self,Event,...)
  171. local Trigger = Mouse[Event]
  172. if Trigger and Trigger.fakeEvent and Trigger.Connections then
  173. for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end
  174. end
  175. end
  176. Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent
  177. Event.OnServerEvent:Connect(function(FiredBy,Input)
  178. if FiredBy.Name ~= owner.Name then return end
  179. if Input.MouseEvent then
  180. Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
  181. else
  182. local Begin = Input.UserInputState == Enum.UserInputState.Begin
  183. if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end
  184. for _,Action in pairs(ContextActionService.Actions) do
  185. for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
  186. end
  187. Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
  188. UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
  189. end
  190. end)
  191. InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
  192. Event.Parent = NLS([[
  193. local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
  194. local Input = function(Input,gameProcessedEvent)
  195. if gameProcessedEvent then return end
  196. Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
  197. end
  198. UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
  199. local Hit,Target
  200. while wait(1/30) do
  201. if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
  202. Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
  203. end
  204. end
  205. ]],owner.Character)
  206. end
  207. RealGame = game;game = setmetatable({},{
  208. __index = function (self,Index)
  209. local Sandbox = function (Thing)
  210. if Thing:IsA("Player") then
  211. local RealPlayer = Thing
  212. return setmetatable({},{
  213. __index = function (self,Index)
  214. local Type = type(RealPlayer[Index])
  215. if Type == "function" then
  216. if Index:lower() == "getmouse" or Index:lower() == "mouse" then
  217. return function (self)return InternalData["Mouse"] end
  218. end
  219. return function (self,...)return RealPlayer[Index](RealPlayer,...) end
  220. end
  221. return RealPlayer[Index]
  222. end;
  223. __tostring = function(self) return RealPlayer.Name end
  224. })
  225. end
  226. end
  227. if RealGame[Index] then
  228. local Type = type(RealGame[Index])
  229. if Type == "function" then
  230. if Index:lower() == "getservice" or Index:lower() == "service" then
  231. return function (self,Service)
  232. local FakeServices = {
  233. ["players"] = function()
  234. return setmetatable({},{
  235. __index = function (self2,Index2)
  236. local RealService = RealGame:GetService(Service)
  237. local Type2 = type(Index2)
  238. if Type2 == "function" then
  239. return function (self,...) return RealService[Index2](RealService,...)end
  240. else
  241. if Index2:lower() == "localplayer" then return Sandbox(owner) end
  242. return RealService[Index2]
  243. end
  244. end;
  245. __tostring = function(self) return RealGame:GetService(Service).Name end
  246. })
  247. end;
  248. ["contextactionservice"] = function() return InternalData["ContextActionService"] end;
  249. ["userinputservice"] = function() return InternalData["UserInputService"] end;
  250. ["runservice"] = function()
  251. return setmetatable({},{
  252. __index = function(self2,Index2)
  253. local RealService = RealGame:GetService(Service)
  254. local Type2 = type(Index2)
  255. if Type2 == "function" then
  256. return function (self,...) return RealService[Index2](RealService,...) end
  257. else
  258. local RunServices = {
  259. ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
  260. ["renderstepped"] = function() return RealService["Stepped"] end
  261. }
  262. if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
  263. return RealService[Index2]
  264. end
  265. end
  266. })
  267. end
  268. }
  269. if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
  270. return RealGame:GetService(Service)
  271. end
  272. end
  273. return function (self,...) return RealGame[Index](RealGame,...) end
  274. else
  275. if game:GetService(Index) then return game:GetService(Index) end
  276. return RealGame[Index]
  277. end
  278. end
  279. return nil
  280. end
  281. });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete! Running...")
  282.  
  283. local Part = Instance.new("Part")
  284. Part.Name = "Pin Ring"
  285. Part.BrickColor = BrickColor.new("Dark stone grey")
  286. Part.TopSurface = 0
  287. Part.BottomSurface = 0
  288. Part.FormFactor = "Custom"
  289. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  290. Part.Parent = Parts
  291. Instance.new("CylinderMesh", Part).Scale = Vector3.new(0.75, 0.1, 0.75)
  292. local Weld = Instance.new("Weld")
  293. Weld.Part0 = Part
  294. Weld.Part1 = MasterPart2
  295. Weld.C0 = CFrame.new(0.1, 0, 0) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
  296. Weld.Parent = Weld.Part0
  297.  
  298. for _, Part in pairs(Parts:GetChildren()) do
  299. Part.Locked = true
  300. Part.CanCollide = false
  301. end
  302. end
  303.  
  304.  
  305. function RemoveParts(Parent, Format)
  306. if Format == 1 then
  307. pcall(function() Parent[ModelName.. " (Holstered)"]:Remove() end)
  308. elseif Format == 2 then
  309. pcall(function() Parent[ModelName]:Remove() end)
  310. end
  311. end
  312.  
  313.  
  314. function SetAngle(Joint, Angle, Character)
  315. if Character == nil then return false end
  316. local Joints = {
  317. Character.Torso:FindFirstChild("Right Shoulder 2"),
  318. Character.Torso:FindFirstChild("Left Shoulder 2"),
  319. Character.Torso:FindFirstChild("Right Hip 2"),
  320. Character.Torso:FindFirstChild("Left Hip 2")
  321. }
  322. if Joints[Joint] == nil then return false end
  323. if Joint == 1 or Joint == 3 then
  324. Joints[Joint].DesiredAngle = Angle
  325. end
  326. if Joint == 2 or Joint == 4 then
  327. Joints[Joint].DesiredAngle = -Angle
  328. end
  329. end
  330.  
  331.  
  332. function ForceAngle(Joint, Angle, Character)
  333. if Character == nil then return false end
  334. local Joints = {
  335. Character.Torso:FindFirstChild("Right Shoulder 2"),
  336. Character.Torso:FindFirstChild("Left Shoulder 2"),
  337. Character.Torso:FindFirstChild("Right Hip 2"),
  338. Character.Torso:FindFirstChild("Left Hip 2")
  339. }
  340. if Joints[Joint] == nil then return false end
  341. if Joint == 1 or Joint == 3 then
  342. Joints[Joint].DesiredAngle = Angle
  343. Joints[Joint].CurrentAngle = Angle
  344. end
  345. if Joint == 2 or Joint == 4 then
  346. Joints[Joint].DesiredAngle = -Angle
  347. Joints[Joint].CurrentAngle = -Angle
  348. end
  349. end
  350.  
  351.  
  352. function SetSpeed(Joint, Speed, Character)
  353. if Character == nil then return false end
  354. local Joints = {
  355. Character.Torso:FindFirstChild("Right Shoulder 2"),
  356. Character.Torso:FindFirstChild("Left Shoulder 2"),
  357. Character.Torso:FindFirstChild("Right Hip 2"),
  358. Character.Torso:FindFirstChild("Left Hip 2")
  359. }
  360. if Joints[Joint] == nil then return false end
  361. Joints[Joint].MaxVelocity = Speed
  362. end
  363.  
  364.  
  365. function DisableLimb(Limb, Character)
  366. if Character == nil then return false end
  367. if Character:FindFirstChild("Torso") == nil then return false end
  368. local Joints = {
  369. Character.Torso:FindFirstChild("Right Shoulder"),
  370. Character.Torso:FindFirstChild("Left Shoulder"),
  371. Character.Torso:FindFirstChild("Right Hip"),
  372. Character.Torso:FindFirstChild("Left Hip")
  373. }
  374. local Limbs = {
  375. Character:FindFirstChild("Right Arm"),
  376. Character:FindFirstChild("Left Arm"),
  377. Character:FindFirstChild("Right Leg"),
  378. Character:FindFirstChild("Left Leg")
  379. }
  380. if Joints[Limb] == nil then return false end
  381. if Limbs[Limb] == nil then return false end
  382. local Joint = Instance.new("Motor6D")
  383. Joint.Parent = Character.Torso
  384. Joint.Part0 = Character.Torso
  385. Joint.Part1 = Limbs[Limb]
  386. if Limb == 1 then
  387. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  388. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  389. Joint.Name = "Right Shoulder 2"
  390. elseif Limb == 2 then
  391. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  392. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  393. Joint.Name = "Left Shoulder 2"
  394. elseif Limb == 3 then
  395. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  396. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  397. Joint.Name = "Right Hip 2"
  398. elseif Limb == 4 then
  399. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  400. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  401. Joint.Name = "Left Hip 2"
  402. end
  403. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  404. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  405. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  406. Joints[Limb]:Remove()
  407. end
  408.  
  409.  
  410. function ResetLimbCFrame(Limb, Character)
  411. if Character == nil then return false end
  412. if Character.Parent == nil then return false end
  413. if Character:FindFirstChild("Torso") == nil then return false end
  414. local Joints = {
  415. Character.Torso:FindFirstChild("Right Shoulder 2"),
  416. Character.Torso:FindFirstChild("Left Shoulder 2"),
  417. Character.Torso:FindFirstChild("Right Hip 2"),
  418. Character.Torso:FindFirstChild("Left Hip 2")
  419. }
  420. local Limbs = {
  421. Character:FindFirstChild("Right Arm"),
  422. Character:FindFirstChild("Left Arm"),
  423. Character:FindFirstChild("Right Leg"),
  424. Character:FindFirstChild("Left Leg")
  425. }
  426. if Joints[Limb] == nil then return false end
  427. if Limbs[Limb] == nil then return false end
  428. if Limb == 1 then
  429. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  430. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  431. elseif Limb == 2 then
  432. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  433. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  434. elseif Limb == 3 then
  435. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  436. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  437. elseif Limb == 4 then
  438. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  439. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  440. end
  441. end
  442.  
  443.  
  444. function EnableLimb(Limb, Character)
  445. if Character == nil then return false end
  446. if Character:FindFirstChild("Torso") == nil then return false end
  447. local Joints = {
  448. Character.Torso:FindFirstChild("Right Shoulder 2"),
  449. Character.Torso:FindFirstChild("Left Shoulder 2"),
  450. Character.Torso:FindFirstChild("Right Hip 2"),
  451. Character.Torso:FindFirstChild("Left Hip 2")
  452. }
  453. local Limbs = {
  454. Character:FindFirstChild("Right Arm"),
  455. Character:FindFirstChild("Left Arm"),
  456. Character:FindFirstChild("Right Leg"),
  457. Character:FindFirstChild("Left Leg")
  458. }
  459. if Joints[Limb] == nil then return false end
  460. if Limbs[Limb] == nil then return false end
  461. if Limb == 1 then
  462. Joints[Limb].Name = "Right Shoulder"
  463. elseif Limb == 2 then
  464. Joints[Limb].Name = "Left Shoulder"
  465. elseif Limb == 3 then
  466. Joints[Limb].Name = "Right Hip"
  467. elseif Limb == 4 then
  468. Joints[Limb].Name = "Left Hip"
  469. end
  470. Animate = Character:FindFirstChild("Animate")
  471. if Animate == nil then return false end
  472. Animate = Animate:Clone()
  473. Character.Animate:Remove()
  474. Animate.Parent = Character
  475. end
  476.  
  477.  
  478. function onButton1Down(Mouse)
  479. if Button1Down == true then return end
  480. Button1Down = true
  481. if CheckPlayer() == false or Primed == true or Thrown == true or CanUse == false then return end
  482. CanUse = false
  483. Primed = true
  484. SoundToServer("Pin", "http://www.roblox.com/Asset/?id=2697295", 5, 1, false, Player.Character.Torso)
  485. pcall(function() Player.Character[ModelName].Pin.Weld:Remove() end)
  486. for _, Part in pairs(Player.Character[ModelName]:GetChildren()) do
  487. pcall(function()
  488. if string.match(Part.Name, "Pin") then
  489. Part.CanCollide = true
  490. end
  491. end)
  492. end
  493. Instance.new("Configuration", Player.Character[ModelName].Handle).Name = "CanExplode"
  494. SendToServer([[local MaxDistance = 30
  495. wait(4)
  496. local Sound = Instance.new("Sound")
  497. Sound.Name = "Hiss"
  498. Sound.SoundId = "rbxasset://sounds/Rocket whoosh 01.wav"
  499. Sound.Volume = 0.25
  500. Sound.Pitch = 2
  501. Sound.Parent = Source
  502. local Smoke1 = Instance.new("Smoke", Source)
  503. Smoke1.Color = Color3.new(218 / 255, 165 / 255, 32 / 255)
  504. Smoke1.Size = MaxDistance
  505. Smoke1.RiseVelocity = 0
  506. local Smoke2 = nil
  507. pcall(function()
  508. Smoke2 = Instance.new("Smoke", Source.Parent["Pin Holder"])
  509. Smoke2.Color = Color3.new(218 / 255, 165 / 255, 32 / 255)
  510. Smoke2.Size = MaxDistance / 9
  511. Smoke2.RiseVelocity = MaxDisance / 2
  512. end)
  513. for i = 0, 1, 0.00125 do
  514. local Amount = (i < 0.5 and i or (1 - i)) * 2
  515. Smoke1.Opacity = Amount * 0.3
  516. pcall(function() Smoke2.Opacity = Amount end)
  517. Sound.Volume = Amount
  518. Sound:Play()
  519. for _, Player in pairs(game:GetService("Players"):GetPlayers()) do
  520. if Player.Character ~= nil then
  521. if Player.Character:FindFirstChild("Head") ~= nil then
  522. local HasMask = false
  523. for _, Part in pairs(Player.Character:GetChildren()) do
  524. if Part.Name == "Gas Mask" then
  525. HasMask = true
  526. end
  527. end
  528. if HasMask == false then
  529. local Distance = (Player.Character.Head.Position - Source.Position).magnitude
  530. if Distance < MaxDistance then
  531. pcall(function() Player.Character.Humanoid:TakeDamage((((MaxDistance - Distance) / MaxDistance) * 0.5) * Amount) end)
  532. local StunGui = Instance.new("ScreenGui", Player.PlayerGui)
  533. StunGui.Name = "StunGui"
  534. local Yellow = Instance.new("Frame", StunGui)
  535. Yellow.Name = "Yellow"
  536. Yellow.BorderSizePixel = 0
  537. Yellow.BackgroundColor3 = Color3.new(218 / 255, 165 / 255, 32 / 255)
  538. Yellow.BackgroundTransparency = 0.95
  539. Yellow.Size = UDim2.new(2, 0, 2, 0)
  540. Yellow.Position = UDim2.new(-0.5, 0, -0.5, 0)
  541. coroutine.wrap(function()
  542. wait((((MaxDistance - Distance) / MaxDistance) * 2) * Amount)
  543. StunGui:Remove()
  544. end)()
  545. end
  546. end
  547. end
  548. end
  549. end
  550. wait()
  551. end
  552. Smoke1.Enabled = false
  553. pcall(function() Smoke2.Enabled = false end)
  554. wait(7.5)
  555. Source.Parent:Remove()]], "Smoke", {"Source", Player.Character[ModelName].Handle})
  556. Player.Character[ModelName].Changed:connect(function(Property)
  557. if Property == "Parent" then
  558. while CanUse == false do wait() end
  559. EnableLimb(1, Player.Character)
  560. UpdateFirstPerson()
  561. script.Parent:Remove()
  562. end
  563. end)
  564. CanUse = true
  565. end
  566.  
  567.  
  568. function onButton1Up(Mouse)
  569. if Button1Down == false then return end
  570. Button1Down = false
  571. if CanUse == false then return end
  572. if Player.Character:FindFirstChild(ModelName) ~= nil and Thrown == false then
  573. Thrown = true
  574. SetSpeed(1, 0.75, Player.Character)
  575. SetAngle(1, 0, Player.Character)
  576. wait()
  577. pcall(function() Player.Character[ModelName].Handle.Weld:Remove() end)
  578. for _, Part in pairs(Player.Character[ModelName]:GetChildren()) do
  579. pcall(function() Part.CanCollide = true end)
  580. end
  581. local BodyVelocity = Instance.new("BodyVelocity")
  582. BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  583. BodyVelocity.velocity = (Mouse.Hit.p - Player.Character[ModelName].Handle.Position).unit * 75
  584. BodyVelocity.Parent = Player.Character[ModelName].Handle
  585. game:GetService("Debris"):AddItem(BodyVelocity, 0.1)
  586. game:GetService("Debris"):AddItem(Player.Character[ModelName], 45)
  587. Player.Character[ModelName].Parent = Workspace
  588. end
  589. end
  590.  
  591.  
  592. function onKeyDown(Key, Mouse)
  593. if Selected == false then return end
  594. Key = Key:lower()
  595. if Button1Down == false and CanUse == true and CheckPlayer() == true then
  596. if Key == "q" then
  597. if Mouse.Target == nil then return end
  598. if CheckPlayer() == false then return end
  599. local NewPlayer = game:GetService("Players"):GetPlayerFromCharacter(Mouse.Target.Parent)
  600. if NewPlayer == nil then return end
  601. if NewPlayer.Character == nil then return end
  602. if NewPlayer.Character:FindFirstChild("Torso") == nil then return end
  603. if (NewPlayer.Character.Torso.Position - Player.Character.Torso.Position).magnitude > 10 then return end
  604. onDeselected(Mouse)
  605. wait()
  606. RemoveParts(Player.Character, 1)
  607. script.Parent.Parent = NewPlayer.Backpack
  608. Player = NewPlayer
  609. elseif Key == "g" then
  610. CanUse = false
  611. SoundToServer("Slash", "rbxasset://sounds/swordslash.wav", 2, 1, false, Player.Character.Torso)
  612. SetSpeed(1, 0.75, Player.Character)
  613. SetAngle(1, 0, Player.Character)
  614. local HasHit = false
  615. local _, HitConnection = pcall(function() return Player.Character[ModelName].Handle.Touched:connect(function(Hit)
  616. if HasHit == true or Hit:IsDescendantOf(Player.Character) then return end
  617. HasHit = true
  618. SoundToServer("Bash", "http://www.roblox.com/Asset/?id=46153268", 1, 0.25, false, Player.Character.Torso)
  619. local Humanoid = Hit.Parent:FindFirstChild("Humanoid") or Hit.Parent.Parent:FindFirstChild("Humanoid")
  620. if Humanoid ~= nil then
  621. tagHumanoid(Humanoid)
  622. Humanoid:TakeDamage(7)
  623. wait()
  624. pcall(function() untagHumanoid(Humanoid) end)
  625. end
  626. end) end)
  627. CameraSlide(math.rad(-15), 0, 0.2)
  628. pcall(function() HitConnection:disconnect() end)
  629. SetSpeed(1, 0.5, Player.Character)
  630. SetAngle(1, math.rad(200), Player.Character)
  631. CameraSlide(math.rad(15), 0, 0.25)
  632. CanUse = true
  633. end
  634. end
  635. end
  636.  
  637.  
  638. function onSelected(Mouse)
  639. if Selected == true or CanUse == false then return end
  640. CanUse = false
  641. while true do
  642. if CheckPlayer() == true then
  643. if Player.Character.Torso:FindFirstChild("Right Shoulder") ~= nil then
  644. break
  645. end
  646. end
  647. wait(0.1)
  648. end
  649. Selected = true
  650. RemoveParts(Player.Character, 1)
  651. CreateParts(Player.Character, 2)
  652. DisableLimb(1, Player.Character)
  653. SetSpeed(1, 0.5, Player.Character)
  654. SetAngle(1, math.rad(200), Player.Character)
  655. Mouse.Icon = "rbxasset://textures\\GunCursor.png"
  656. Mouse.Button1Down:connect(function() onButton1Down(Mouse) end)
  657. Mouse.Button1Up:connect(function() onButton1Up(Mouse) end)
  658. Mouse.KeyDown:connect(function(Key) onKeyDown(Key, Mouse) end)
  659. CanUse = true
  660. end
  661.  
  662.  
  663. function onDeselected(Mouse)
  664. if Selected == false or Primed == true then return end
  665. Selected = false
  666. while CanUse == false do wait() end
  667. if Selected == true then return end
  668. CanUse = false
  669. RemoveParts(Player.Character, 2)
  670. CreateParts(Player.Character, 1)
  671. SetAngle(1, 0, Player.Character)
  672. ResetLimbCFrame(1, Player.Character)
  673. EnableLimb(1, Player.Character)
  674. CanUse = true
  675. end
  676.  
  677.  
  678. if script.Parent.ClassName ~= "HopperBin" then
  679. if Player == nil then print("Error: Player not found!") return end
  680. Tool = Instance.new("HopperBin")
  681. Tool.Name = ModelName
  682. Tool.Parent = Player.Backpack
  683. script.Name = "Main"
  684. script.Parent = Tool
  685. elseif script.Parent.ClassName == "HopperBin" and Connected == false then
  686. Connected = true
  687. Player = script.Parent.Parent.Parent
  688. script.Parent.Selected:connect(onSelected)
  689. script.Parent.Deselected:connect(onDeselected)
  690. CreateParts(Player.Character, 1)
  691. coroutine.wrap(loadstring(FirstPerson))()
  692. coroutine.wrap(loadstring(MouseAim))()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement