Hugo1234cool

Untitled

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