Advertisement
Hugo1234cool

Untitled

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