Advertisement
Guest User

jnfjeshngiewgjvwenijgerjgnrejgnr

a guest
Feb 9th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.85 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. print("A hyper shotgun maded by pdnghiaqoi!")
  20. Tool0 = Instance.new("Tool")
  21. Part1 = Instance.new("Part")
  22. SpecialMesh2 = Instance.new("SpecialMesh")
  23. Sound3 = Instance.new("Sound")
  24. Sound4 = Instance.new("Sound")
  25. PointLight5 = Instance.new("PointLight")
  26. Weld6 = Instance.new("Weld")
  27. Weld7 = Instance.new("Weld")
  28. Weld8 = Instance.new("Weld")
  29. LocalScript9 = Instance.new("LocalScript")
  30. Sound10 = Instance.new("Sound")
  31. LocalScript11 = Instance.new("LocalScript")
  32. Part12 = Instance.new("Part")
  33. SpecialMesh13 = Instance.new("SpecialMesh")
  34. PointLight14 = Instance.new("PointLight")
  35. Script15 = Instance.new("Script")
  36. Script16 = Instance.new("Script")
  37. Tool0.Name = "LaserShotGun"
  38. Tool0.Parent = mas
  39. Tool0.TextureId = "http://www.roblox.com/asset?id=130093050"
  40. Tool0.GripForward = Vector3.new(-0.376944453, -0.000461966498, -0.926235735)
  41. Tool0.GripPos = Vector3.new(0, 0.200000003, 0.25000003)
  42. Tool0.GripRight = Vector3.new(0.926235914, -0.000188003658, -0.376944423)
  43. Tool0.GripUp = Vector3.new(1.45519152e-11, 0.999999881, -0.000498756883)
  44. Tool0.ToolTip = "A hyper shotgun made and edit by pdnghiaqoi"
  45. Tool0.CanBeDropped = false
  46. Part1.Name = "Handle"
  47. Part1.Parent = Tool0
  48. Part1.Rotation = Vector3.new(-180, 0, -180)
  49. Part1.CanCollide = false
  50. Part1.FormFactor = Enum.FormFactor.Custom
  51. Part1.Size = Vector3.new(0.580000222, 1.34000099, 4.48000145)
  52. Part1.CFrame = CFrame.new(8.28999901, 0.670000017, 25.8400002, -0.999997616, 9.05775108e-12, -1.88592058e-08, -9.13322282e-12, 0.999997377, 6.28057464e-08, -1.53668083e-08, -6.28641601e-08, -0.999999821)
  53. Part1.BottomSurface = Enum.SurfaceType.Smooth
  54. Part1.TopSurface = Enum.SurfaceType.Smooth
  55. Part1.Position = Vector3.new(8.28999901, 0.670000017, 25.8400002)
  56. Part1.Orientation = Vector3.new(0, -180, 0)
  57. SpecialMesh2.Parent = Part1
  58. SpecialMesh2.MeshId = "http://www.roblox.com/asset?id=130099641"
  59. SpecialMesh2.Scale = Vector3.new(1, 0.75, 1.5)
  60. SpecialMesh2.TextureId = "http://www.roblox.com/asset?id=130093033"
  61. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  62. SpecialMesh2.Scale = Vector3.new(1, 0.75, 1.5)
  63. Sound3.Name = "Fire"
  64. Sound3.Parent = Part1
  65. Sound3.Pitch = 0.5
  66. Sound3.SoundId = "http://www.roblox.com/asset?id=130113322"
  67. Sound3.Volume = 1
  68. Sound4.Name = "Reload"
  69. Sound4.Parent = Part1
  70. Sound4.Pitch = 0.5
  71. Sound4.SoundId = "http://www.roblox.com/asset?id=130113370"
  72. PointLight5.Parent = Part1
  73. PointLight5.Color = Color3.new(0, 1, 1)
  74. PointLight5.Range = 6
  75. PointLight5.Color = Color3.new(0, 1, 1)
  76. Weld6.Parent = Part1
  77. Weld6.C0 = CFrame.new(0, 0, 0, -3.17205462e-08, 2.98023188e-08, 0.999999821, 4.42590249e-08, 0.999999821, -2.98023295e-08, -1, 4.42590107e-08, -3.17205746e-08)
  78. Weld6.C1 = CFrame.new(0, 0, 0, -3.17205462e-08, 2.98023188e-08, 0.999999821, 4.42590249e-08, 0.999999821, -2.98023295e-08, -1, 4.42590107e-08, -3.17205746e-08)
  79. Weld6.Part0 = Part1
  80. Weld6.Part1 = Part1
  81. Weld7.Parent = Part1
  82. Weld7.C0 = CFrame.new(0, 0, 0, -0.823671401, 0.00976598449, 0.566983223, 0.566961288, -0.00514982874, 0.823728263, 0.0109643862, 0.999939024, -0.00129515026)
  83. Weld7.C1 = CFrame.new(0, 0, 0, -0.823671401, 0.00976598449, 0.566983223, 0.566961288, -0.00514982874, 0.823728263, 0.0109643862, 0.999939024, -0.00129515026)
  84. Weld7.Part0 = Part1
  85. Weld7.Part1 = Part1
  86. Weld8.Parent = Part1
  87. Weld8.C0 = CFrame.new(0, 0, 0, -0.823671401, 0.00976598449, 0.566983223, 0.566961288, -0.00514982874, 0.823728263, 0.0109643862, 0.999939024, -0.00129515026)
  88. Weld8.C1 = CFrame.new(-0.399999499, 0, 1.1920929e-07, -0.823670983, 0.00976601522, 0.566982925, 0.56696099, -0.00514967833, 0.823727846, 0.0109643312, 0.999939024, -0.00129529205)
  89. Weld8.Part0 = Part1
  90. Weld8.Part1 = Part12
  91. LocalScript9.Name = "ToolScript"
  92. LocalScript9.Parent = Tool0
  93. table.insert(cors,sandbox(LocalScript9,function()
  94. -----------------
  95. --| Constants |--
  96. -----------------
  97.  
  98. local SHOT_SPEED =250
  99. local SHOT_TIME = 0.1
  100.  
  101. local NOZZLE_OFFSET = Vector3.new(0, 0.4, -1.1)
  102.  
  103. -----------------
  104. --| Variables |--
  105. -----------------
  106.  
  107. local PlayersService = Game:GetService('Players')
  108. local DebrisService = Game:GetService('Debris')
  109.  
  110. local Tool = script.Parent
  111. local Handle = Tool:WaitForChild('Handle')
  112.  
  113. local FireSound = Handle:WaitForChild('Fire')
  114. local ReloadSound = Handle:WaitForChild('Reload')
  115. local HitFadeSound = script:WaitForChild('HitFade')
  116.  
  117. local PointLight = Handle:WaitForChild('PointLight')
  118.  
  119. local Character = nil
  120. local Humanoid = nil
  121. local Player = nil
  122.  
  123. local BaseShot = nil
  124.  
  125. -----------------
  126. --| Functions |--
  127. -----------------
  128.  
  129. -- Returns a character ancestor and its Humanoid, or nil
  130. local function FindCharacterAncestor(subject)
  131. if subject and subject ~= Workspace then
  132. local humanoid = subject:FindFirstChild('Humanoid')
  133. if humanoid then
  134. return subject, humanoid
  135. else
  136. return FindCharacterAncestor(subject.Parent)
  137. end
  138. end
  139. return nil
  140. end
  141.  
  142. -- Removes any old creator tags and applies new ones to the specified target
  143. local function ApplyTags(target)
  144. while target:FindFirstChild('creator') do
  145. target.creator:Destroy()
  146. end
  147.  
  148. local creatorTag = Instance.new('ObjectValue')
  149. creatorTag.Value = Player
  150. creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
  151.  
  152. local iconTag = Instance.new('StringValue')
  153. iconTag.Value = Tool.TextureId
  154. iconTag.Name = 'icon'
  155.  
  156. iconTag.Parent = creatorTag
  157. creatorTag.Parent = target
  158. DebrisService:AddItem(creatorTag, 4)
  159. end
  160.  
  161. -- Returns all objects under instance with Transparency
  162. local function GetTransparentsRecursive(instance, partsTable)
  163. local partsTable = partsTable or {}
  164. for _, child in pairs(instance:GetChildren()) do
  165. if child:IsA('BasePart') or child:IsA('Decal') then
  166. table.insert(partsTable, child)
  167. end
  168. GetTransparentsRecursive(child, partsTable)
  169. end
  170. return partsTable
  171. end
  172.  
  173. local function SelectionBoxify(instance)
  174. local selectionBox = Instance.new('SelectionBox')
  175. selectionBox.Adornee = instance
  176. selectionBox.Color = BrickColor.new('Toothpaste')
  177. selectionBox.Parent = instance
  178. return selectionBox
  179. end
  180.  
  181. local function Light(instance)
  182. local light = PointLight:Clone()
  183. light.Range = light.Range + 2
  184. light.Parent = instance
  185. end
  186.  
  187. local function FadeOutObjects(objectsWithTransparency, fadeIncrement)
  188. repeat
  189. local lastObject = nil
  190. for _, object in pairs(objectsWithTransparency) do
  191. object.Transparency = object.Transparency + fadeIncrement
  192. lastObject = object
  193. end
  194. wait()
  195. until lastObject.Transparency >= 1 or not lastObject
  196. end
  197.  
  198. local function Dematerialize(character, humanoid, firstPart)
  199. humanoid.WalkSpeed = 0
  200.  
  201. local parts = {}
  202. for _, child in pairs(character:GetChildren()) do
  203. if child:IsA('BasePart') then
  204. child.Anchored = true
  205. table.insert(parts, child)
  206. elseif child:IsA('LocalScript') or child:IsA('Script') then
  207. child:Destroy()
  208. end
  209. end
  210.  
  211. local selectionBoxes = {}
  212.  
  213. local firstSelectionBox = SelectionBoxify(firstPart)
  214. Light(firstPart)
  215. wait(0.05)
  216.  
  217. for _, part in pairs(parts) do
  218. if part ~= firstPart then
  219. table.insert(selectionBoxes, SelectionBoxify(part))
  220. Light(part)
  221. end
  222. end
  223.  
  224. local objectsWithTransparency = GetTransparentsRecursive(character)
  225. FadeOutObjects(objectsWithTransparency, 0.1)
  226.  
  227. wait(0.5)
  228.  
  229. humanoid.Health = 0
  230. DebrisService:AddItem(character, 2)
  231.  
  232. local fadeIncrement = 0.05
  233. Delay(0.2, function()
  234. FadeOutObjects({firstSelectionBox}, fadeIncrement)
  235. if character then
  236. character:Destroy()
  237. end
  238. end)
  239. FadeOutObjects(selectionBoxes, fadeIncrement)
  240. end
  241.  
  242. local function OnTouched(shot, otherPart)
  243. local character, humanoid = FindCharacterAncestor(otherPart)
  244. if character and humanoid and character ~= Character then
  245. ApplyTags(humanoid)
  246. if shot then
  247. local hitFadeSound = shot:FindFirstChild(HitFadeSound.Name)
  248. if hitFadeSound then
  249. hitFadeSound.Parent = humanoid.Torso
  250. hitFadeSound:Play()
  251. end
  252. shot:Destroy()
  253. end
  254. Dematerialize(character, humanoid, otherPart)
  255. end
  256. end
  257.  
  258. local function OnEquipped()
  259. Character = Tool.Parent
  260. Humanoid = Character:WaitForChild('Humanoid')
  261. Player = PlayersService:GetPlayerFromCharacter(Character)
  262. end
  263.  
  264. local function OnActivated()
  265. if Tool.Enabled and Humanoid.Health > 0 then
  266. Tool.Enabled = false
  267.  
  268. FireSound:Play()
  269.  
  270. local handleCFrame = Handle.CFrame
  271. local firingPoint = handleCFrame.p + handleCFrame:vectorToWorldSpace(NOZZLE_OFFSET)
  272. for i=1, 25 do
  273. local target=Humanoid.TargetPoint
  274. target = CFrame.Angles((0.5 - math.random()) * 2 * (math.random()*.04),
  275. (0.5 - math.random()) * 2 * (math.random()*.04),
  276. (0.5 - math.random()) * 2 * (math.random()*.04)) * target
  277.  
  278. local shotCFrame = CFrame.new(firingPoint, target)
  279.  
  280.  
  281. local laserShotClone = BaseShot:Clone()
  282. laserShotClone.CFrame = shotCFrame + (shotCFrame.lookVector * (BaseShot.Size.Z / 2))
  283. local bodyVelocity = Instance.new('BodyVelocity')
  284. bodyVelocity.velocity = shotCFrame.lookVector * SHOT_SPEED
  285. bodyVelocity.Parent = laserShotClone
  286. laserShotClone.Touched:connect(function(otherPart)
  287. OnTouched(laserShotClone, otherPart)
  288. end)
  289. DebrisService:AddItem(laserShotClone, SHOT_TIME)
  290. laserShotClone.Parent = Tool
  291. end
  292.  
  293. Tool.GripPos=Vector3.new(0,.2,-.5)
  294. Tool.GripRight=Vector3.new(0.926,.2,-0.377)
  295. wait(.1)
  296. Tool.GripPos=Vector3.new(0,.2,-0.25)
  297. Tool.GripRight=Vector3.new(0.926,.15,-0.377)
  298. wait(.1)
  299. Tool.GripPos=Vector3.new(0,0.2,0)
  300. Tool.GripRight=Vector3.new(0.926,.1,-0.377)
  301. wait(.1)
  302. Tool.GripPos=Vector3.new(0,0.2,0.125)
  303. Tool.GripRight=Vector3.new(0.926,.05,-0.377)
  304. wait(.1)
  305. Tool.GripPos=Vector3.new(0,0.2,0.25)
  306. Tool.GripRight=Vector3.new(0.926,0,-0.377)
  307. wait(.25)
  308.  
  309. ReloadSound:Play()
  310. wait(1.25) -- ReloadSound length
  311.  
  312. Tool.Enabled = true
  313. end
  314. end
  315.  
  316. local function OnUnequipped()
  317.  
  318. end
  319.  
  320. --------------------
  321. --| Script Logic |--
  322. --------------------
  323.  
  324. BaseShot = Instance.new('Part')
  325. BaseShot.Name = 'Effect'
  326. BaseShot.FormFactor = Enum.FormFactor.Custom
  327. BaseShot.Size = Vector3.new(0.2, 0.2, 3)
  328. BaseShot.CanCollide = false
  329. BaseShot.BrickColor = BrickColor.new('Toothpaste')
  330. SelectionBoxify(BaseShot)
  331. Light(BaseShot)
  332. HitFadeSound:Clone().Parent = BaseShot
  333.  
  334. Tool.Equipped:connect(OnEquipped)
  335. Tool.Unequipped:connect(OnUnequipped)
  336. Tool.Activated:connect(OnActivated)
  337.  
  338. end))
  339. Sound10.Name = "HitFade"
  340. Sound10.Parent = LocalScript9
  341. Sound10.SoundId = "http://www.roblox.com/asset?id=130113415"
  342. LocalScript11.Name = "MouseIcon"
  343. LocalScript11.Parent = Tool0
  344. table.insert(cors,sandbox(LocalScript11,function()
  345. local MOUSE_ICON = 'rbxasset://textures/GunCursor.png'
  346. local RELOADING_ICON = 'rbxasset://textures/GunWaitCursor.png'
  347.  
  348. local Tool = script.Parent
  349.  
  350. local Mouse = nil
  351.  
  352. local function UpdateIcon()
  353. if Mouse then
  354. Mouse.Icon = Tool.Enabled and MOUSE_ICON or RELOADING_ICON
  355. end
  356. end
  357.  
  358. local function OnEquipped(mouse)
  359. Mouse = mouse
  360. UpdateIcon()
  361. end
  362.  
  363. local function OnChanged(property)
  364. if property == 'Enabled' then
  365. UpdateIcon()
  366. end
  367. end
  368.  
  369. Tool.Equipped:connect(OnEquipped)
  370. Tool.Changed:connect(OnChanged)
  371.  
  372. end))
  373. Part12.Name = "Barrel2"
  374. Part12.Parent = Tool0
  375. Part12.Rotation = Vector3.new(180, 0, 180)
  376. Part12.FormFactor = Enum.FormFactor.Custom
  377. Part12.Size = Vector3.new(0.580000222, 1.34000099, 4.48000145)
  378. Part12.CFrame = CFrame.new(7.88999987, 0.670000017, 25.8400002, -0.999998212, -2.97932274e-08, 2.60770321e-08, -2.98114173e-08, 0.999998033, -1.00757461e-07, -4.09781933e-08, -1.94995664e-07, -0.999999881)
  379. Part12.BottomSurface = Enum.SurfaceType.Smooth
  380. Part12.TopSurface = Enum.SurfaceType.Smooth
  381. Part12.Position = Vector3.new(7.88999987, 0.670000017, 25.8400002)
  382. Part12.Orientation = Vector3.new(0, 180, 0)
  383. SpecialMesh13.Parent = Part12
  384. SpecialMesh13.MeshId = "http://www.roblox.com/asset?id=130099641"
  385. SpecialMesh13.Scale = Vector3.new(1, 0.75, 1.5)
  386. SpecialMesh13.TextureId = "http://www.roblox.com/asset?id=130093033"
  387. SpecialMesh13.MeshType = Enum.MeshType.FileMesh
  388. SpecialMesh13.Scale = Vector3.new(1, 0.75, 1.5)
  389. PointLight14.Parent = Part12
  390. PointLight14.Color = Color3.new(0, 1, 1)
  391. PointLight14.Range = 6
  392. PointLight14.Color = Color3.new(0, 1, 1)
  393. Script15.Name = "Weld"
  394. Script15.Parent = Tool0
  395. table.insert(cors,sandbox(Script15,function()
  396. function Weld(x,y)
  397. local W = Instance.new("Weld")
  398. W.Part0 = x
  399. W.Part1 = y
  400. local CJ = CFrame.new(x.Position)
  401. local C0 = x.CFrame:inverse()*CJ
  402. local C1 = y.CFrame:inverse()*CJ
  403. W.C0 = C0
  404. W.C1 = C1
  405. W.Parent = x
  406. end
  407.  
  408. function Get(A)
  409. if A.className == "Part" or A.className == "UnionOperation"then
  410. Weld(script.Parent.Handle, A)
  411. A.Anchored = false
  412. else
  413. local C = A:GetChildren()
  414. for i=1, #C do
  415. Get(C[i])
  416. end
  417. end
  418. end
  419.  
  420. function Finale()
  421. Get(script.Parent)
  422. end
  423.  
  424. script.Parent.Equipped:connect(Finale)
  425. script.Parent.Unequipped:connect(Finale)
  426. Finale()
  427. end))
  428. Script16.Name = "WeldArm"
  429. Script16.Parent = Tool0
  430. table.insert(cors,sandbox(Script16,function()
  431. Tool = script.Parent
  432.  
  433. local arms = nil
  434. local torso = nil
  435. local welds = {}
  436. local down = false
  437.  
  438. function Equip(mouse)
  439. wait(0.01)
  440. arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
  441. torso = Tool.Parent:FindFirstChild("Torso")
  442. if arms ~= nil and torso ~= nil then
  443. local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
  444. if sh ~= nil then
  445. local yes = true
  446. if yes then
  447. yes = false
  448. sh[1].Part1 = nil
  449. sh[2].Part1 = nil
  450. local weld1 = Instance.new("Weld")
  451. weld1.Part0 = torso
  452. weld1.Parent = torso
  453. weld1.Part1 = arms[1]
  454. weld1.C1 = CFrame.new(-.1, 1.25, .6) * CFrame.fromEulerAnglesXYZ(math.rad(290), math.rad(10), math.rad(-90))
  455. welds[1] = weld1
  456. local weld2 = Instance.new("Weld")
  457. weld2.Part0 = torso
  458. weld2.Parent = torso
  459. weld2.Part1 = arms[2]
  460. weld2.C1 = CFrame.new(-1, -0.5, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-30), 0)
  461. welds[2] = weld2
  462. end
  463. else
  464. print("sh")
  465. end
  466. else
  467. print("arms")
  468. end
  469. end
  470.  
  471. function Unequip(mouse)
  472. if arms ~= nil and torso ~= nil then
  473. local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
  474. if sh ~= nil then
  475. local yes = true
  476. if yes then
  477. yes = false
  478. sh[1].Part1 = arms[1]
  479. sh[2].Part1 = arms[2]
  480. welds[1].Parent = nil
  481. welds[2].Parent = nil
  482. end
  483. else
  484. print("sh")
  485. end
  486. else
  487. print("arms")
  488. end
  489. end
  490.  
  491. Tool.Equipped:connect(Equip)
  492. Tool.Unequipped:connect(Unequip)
  493.  
  494. end))
  495. for i,v in pairs(mas:GetChildren()) do
  496. v.Parent = game:GetService("Players").LocalPlayer.Character
  497. pcall(function() v:MakeJoints() end)
  498. end
  499. mas:Destroy()
  500. for i,v in pairs(cors) do
  501. spawn(function()
  502. pcall(v)
  503. end)
  504. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement