Hugo1234cool

Untitled

Apr 7th, 2019
153
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. 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 = {}
  38. do
  39. script.Parent = owner.Character
  40. local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
  41. local function NewFakeEvent()
  42. local Bind = Instance.new("BindableEvent")
  43. local Fake;Fake = {Connections = {},
  44. fakeEvent=true;
  45. Connect=function(self,Func)
  46. Bind.Event:connect(Func)
  47. self.Connections[Bind] = true
  48. return setmetatable({Connected = true},{
  49. __index = function (self,Index)
  50. if Index:lower() == "disconnect" then
  51. return function() Fake.Connections[Bind] = false;self.Connected = false end
  52. end
  53. return Fake[Index]
  54. end;
  55. __tostring = function() return "Connection" end;
  56. })
  57. end}
  58. Fake.connect = Fake.Connect;return Fake;
  59. end
  60. local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
  61. local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
  62. local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
  63. self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
  64. end};ContextActionService.UnBindAction = ContextActionService.BindAction
  65. local function TriggerEvent(self,Event,...)
  66. local Trigger = Mouse[Event]
  67. if Trigger and Trigger.fakeEvent and Trigger.Connections then
  68. for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end
  69. end
  70. end
  71. Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent
  72. Event.OnServerEvent:Connect(function(FiredBy,Input)
  73. if FiredBy.Name ~= owner.Name then return end
  74. if Input.MouseEvent then
  75. Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
  76. else
  77. local Begin = Input.UserInputState == Enum.UserInputState.Begin
  78. if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end
  79. for _,Action in pairs(ContextActionService.Actions) do
  80. for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
  81. end
  82. Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
  83. UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
  84. end
  85. end)
  86. InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
  87. Event.Parent = NLS([[
  88. local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
  89. local Input = function(Input,gameProcessedEvent)
  90. if gameProcessedEvent then return end
  91. Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
  92. end
  93. UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
  94. local Hit,Target
  95. while wait(1/30) do
  96. if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
  97. Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
  98. end
  99. end
  100. ]],owner.Character)
  101. end
  102. RealGame = game;game = setmetatable({},{
  103. __index = function (self,Index)
  104. local Sandbox = function (Thing)
  105. if Thing:IsA("Player") then
  106. local RealPlayer = Thing
  107. return setmetatable({},{
  108. __index = function (self,Index)
  109. local Type = type(RealPlayer[Index])
  110. if Type == "function" then
  111. if Index:lower() == "getmouse" or Index:lower() == "mouse" then
  112. return function (self)return InternalData["Mouse"] end
  113. end
  114. return function (self,...)return RealPlayer[Index](RealPlayer,...) end
  115. end
  116. return RealPlayer[Index]
  117. end;
  118. __tostring = function(self) return RealPlayer.Name end
  119. })
  120. end
  121. end
  122. if RealGame[Index] then
  123. local Type = type(RealGame[Index])
  124. if Type == "function" then
  125. if Index:lower() == "getservice" or Index:lower() == "service" then
  126. return function (self,Service)
  127. local FakeServices = {
  128. ["players"] = function()
  129. return setmetatable({},{
  130. __index = function (self2,Index2)
  131. local RealService = RealGame:GetService(Service)
  132. local Type2 = type(Index2)
  133. if Type2 == "function" then
  134. return function (self,...) return RealService[Index2](RealService,...)end
  135. else
  136. if Index2:lower() == "localplayer" then return Sandbox(owner) end
  137. return RealService[Index2]
  138. end
  139. end;
  140. __tostring = function(self) return RealGame:GetService(Service).Name end
  141. })
  142. end;
  143. ["contextactionservice"] = function() return InternalData["ContextActionService"] end;
  144. ["userinputservice"] = function() return InternalData["UserInputService"] end;
  145. ["runservice"] = function()
  146. return setmetatable({},{
  147. __index = function(self2,Index2)
  148. local RealService = RealGame:GetService(Service)
  149. local Type2 = type(Index2)
  150. if Type2 == "function" then
  151. return function (self,...) return RealService[Index2](RealService,...) end
  152. else
  153. local RunServices = {
  154. ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
  155. ["renderstepped"] = function() return RealService["Stepped"] end
  156. }
  157. if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
  158. return RealService[Index2]
  159. end
  160. end
  161. })
  162. end
  163. }
  164. if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
  165. return RealGame:GetService(Service)
  166. end
  167. end
  168. return function (self,...) return RealGame[Index](RealGame,...) end
  169. else
  170. if game:GetService(Index) then return game:GetService(Index) end
  171. return RealGame[Index]
  172. end
  173. end
  174. return nil
  175. end
  176. });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete! Running...")
  177.  
  178. function CreateParts(Parent, Format)
  179. if Parent == nil then return end
  180. local Parts = Instance.new("Model")
  181. Parts.Name = ModelName
  182. if Format == 1 then
  183. Parts.Name = Parts.Name.. " (Holstered)"
  184. end
  185. Parts.Parent = Parent
  186.  
  187. local MasterPart = Instance.new("Part")
  188. MasterPart.Name = "Handle"
  189. MasterPart.BrickColor = BrickColor.new("Bright yellow")
  190. MasterPart.TopSurface = 0
  191. MasterPart.BottomSurface = 0
  192. MasterPart.FormFactor = "Custom"
  193. MasterPart.Size = Vector3.new(0.4, 0.9, 0.4)
  194. MasterPart.Parent = Parts
  195. Instance.new("SpecialMesh", MasterPart).MeshType = "Head"
  196. local Weld = Instance.new("Weld")
  197. Weld.Part0 = MasterPart
  198. if Format == 1 then
  199. Weld.Part1 = Player.Character:FindFirstChild("Left Leg")
  200. Weld.C0 = CFrame.new(0.75, 0, 0.7) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
  201. elseif Format == 2 then
  202. Weld.Part1 = Player.Character:FindFirstChild("Right Arm")
  203. Weld.C0 = CFrame.new(0, 0, 1.2) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
  204. end
  205. Weld.Parent = Weld.Part0
  206.  
  207. local Part = Instance.new("Part")
  208. Part.Name = "Stripe Top"
  209. Part.BrickColor = BrickColor.new("Really black")
  210. Part.TopSurface = 0
  211. Part.BottomSurface = 0
  212. Part.FormFactor = "Custom"
  213. Part.Size = Vector3.new(0.45, 0.2, 0.45)
  214. Part.Parent = Parts
  215. Instance.new("CylinderMesh", Part).Scale = Vector3.new(1, 0.1, 1)
  216. local Weld = Instance.new("Weld")
  217. Weld.Part0 = Part
  218. Weld.Part1 = MasterPart
  219. Weld.C0 = CFrame.new(0, -0.2, 0)
  220. Weld.Parent = Weld.Part0
  221.  
  222. local Part = Instance.new("Part")
  223. Part.Name = "Stripe Bottom"
  224. Part.BrickColor = BrickColor.new("Really black")
  225. Part.TopSurface = 0
  226. Part.BottomSurface = 0
  227. Part.FormFactor = "Custom"
  228. Part.Size = Vector3.new(0.45, 0.2, 0.45)
  229. Part.Parent = Parts
  230. Instance.new("CylinderMesh", Part).Scale = Vector3.new(1, 0.1, 1)
  231. local Weld = Instance.new("Weld")
  232. Weld.Part0 = Part
  233. Weld.Part1 = MasterPart
  234. Weld.C0 = CFrame.new(0, 0.2, 0)
  235. Weld.Parent = Weld.Part0
  236.  
  237. local Part = Instance.new("Part")
  238. Part.Name = "Stripe Center"
  239. Part.BrickColor = BrickColor.new("CGA brown")
  240. Part.TopSurface = 0
  241. Part.BottomSurface = 0
  242. Part.FormFactor = "Custom"
  243. Part.Size = Vector3.new(0.425, 0.4, 0.425)
  244. Part.Parent = Parts
  245. Instance.new("CylinderMesh", Part)
  246. local Weld = Instance.new("Weld")
  247. Weld.Part0 = Part
  248. Weld.Part1 = MasterPart
  249. Weld.Parent = Weld.Part0
  250.  
  251. local Part = Instance.new("Part")
  252. Part.Name = "Pin Holder"
  253. Part.BrickColor = BrickColor.new("Dark stone grey")
  254. Part.TopSurface = 0
  255. Part.BottomSurface = 0
  256. Part.FormFactor = "Custom"
  257. Part.Size = Vector3.new(0.2, 0.4, 0.2)
  258. Part.Parent = Parts
  259. Instance.new("CylinderMesh", Part)
  260. local Weld = Instance.new("Weld")
  261. Weld.Part0 = Part
  262. Weld.Part1 = MasterPart
  263. Weld.C0 = CFrame.new(0, -0.5, 0)
  264. Weld.Parent = Weld.Part0
  265.  
  266. local MasterPart2 = Instance.new("Part")
  267. MasterPart2.Name = "Pin"
  268. MasterPart2.BrickColor = BrickColor.new("Dark stone grey")
  269. MasterPart2.TopSurface = 0
  270. MasterPart2.BottomSurface = 0
  271. MasterPart2.FormFactor = "Custom"
  272. MasterPart2.Size = Vector3.new(0.2, 0.2, 0.2)
  273. MasterPart2.Parent = Parts
  274. local Mesh = Instance.new("SpecialMesh", MasterPart2)
  275. Mesh.MeshType = "Brick"
  276. Mesh.Scale = Vector3.new(0.3, 0.1, 0.1)
  277. local Weld = Instance.new("Weld")
  278. Weld.Part0 = MasterPart2
  279. Weld.Part1 = MasterPart
  280. Weld.C0 = CFrame.new(0.125, -0.6, 0)
  281. Weld.Parent = Weld.Part0
  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