Advertisement
KrYn0MoRe

Illegal Shotgun Tool [Old]

Feb 15th, 2024
1,335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.92 KB | None | 0 0
  1. local plr = owner
  2. local char = plr.Character
  3. local hum = char:FindFirstChildOfClass("Humanoid")
  4. local torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart")
  5.  
  6. local debris = game:GetService("Debris")
  7. local tween = game:GetService("TweenService")
  8.  
  9. makenoise = function(asset,part)
  10.     local aud = Instance.new("Sound")
  11.     aud.Parent = part
  12.     aud.SoundId = asset
  13.     if asset == "rbxassetid://722989551" then
  14.         aud.TimePosition = .2
  15.     end
  16.     aud.Playing = true
  17.     aud.Stopped:connect(function()
  18.         wait(1)
  19.         aud:Destroy()
  20.     end)
  21. end
  22.  
  23. local gun = Instance.new("Tool")
  24. gun.Parent = plr['Backpack']
  25. gun.Name = "Illegal Shotgun"
  26. gun.GripForward = Vector3.new(0,0,-1)
  27. gun.GripPos = Vector3.new(0,0,.5)
  28. local han = Instance.new("Part")
  29. han.Parent = gun
  30. han.Name = "Handle"
  31. han.CanCollide = false
  32. han.Massless = true
  33. han.Size = Vector3.new(1,1,4)
  34. local specm = Instance.new("SpecialMesh")
  35. specm.Parent = han
  36. specm.MeshId = "rbxassetid://3835506"
  37. specm.Scale = Vector3.new(1.8,1.5,1)
  38. specm.TextureId = "rbxassetid://19630799"
  39. specm.VertexColor = Vector3.new(math.random(1,255)/255,math.random(1,255)/255,math.random(1,255)/255)
  40.  
  41.  
  42. local cols = {BrickColor.new("Neon orange"),BrickColor.new("Really red"),BrickColor.new("Bright red"),BrickColor.new("Br. yellowish orange"),BrickColor.new("Bright yellow")}
  43. local taunts = {298689061,2743459732,2852509470,1018518369}
  44. local attacking = false
  45. local rapid = true
  46. local op = true
  47. local bulletfire = 10
  48. local reloadwait = 0.15
  49.  
  50. gun.Activated:Connect(function()
  51.     if attacking == false and CheckIfAlive() then
  52.         attacking = true
  53.         makenoise("rbxassetid://722989551",han)
  54.         specm.VertexColor = Vector3.new(math.random(1,255)/255,math.random(1,255)/255,math.random(1,255)/255)
  55.         local exp = Instance.new("Explosion")
  56.         exp.Parent = workspace
  57.         exp.Position = (han.CFrame*CFrame.new(0,0,-2)).Position
  58.         exp.DestroyJointRadiusPercent = 0
  59.         exp.BlastRadius = 20
  60.         exp.BlastPressure = 50000
  61.         for i = 1,bulletfire do
  62.             spawn(function()
  63.                 local p = Instance.new("Part")
  64.                 p.Parent = workspace
  65.                 p.Massless = true
  66.                 p.Name = "bullet"
  67.                 p.Anchored = false
  68.                 p.CanCollide = false
  69.                 p.Size = Vector3.new(2,2,2)
  70.                 p.Transparency = 1
  71.                 p.BrickColor = cols[math.random(1,#cols)]
  72.                 p.CFrame = han.CFrame*CFrame.new(0,0,-2)
  73.                 p.Velocity =  (han.Position-(han.CFrame*CFrame.new(math.random(-20,20)/240,math.random(-20,20)/120,1)).Position).Unit * 200
  74.                 local fire = Instance.new("Fire",p)
  75.                 fire.Size = 15
  76.                 fire.Heat = 0
  77.                 fire.Color = p.Color
  78.                 local smok = Instance.new("Smoke",p)
  79.                 smok.Opacity = .1
  80.                 debris:AddItem(p,1)
  81.                 p.Touched:connect(function(obj)
  82.                     if obj.Name ~= "bullet" and obj.Name ~= "Handle" then
  83.                         local targhum = obj.Parent:FindFirstChildOfClass("Humanoid")
  84.                         local targhead = obj.Parent:FindFirstChild("Head")
  85.                         if targhum and targhum ~= hum and targhead and targhead.Parent ~= char and not targhum:FindFirstChild("shot shell confirm - kry") then
  86.                             --if (head.Position-p.Position).Magnitude < 5 and hum.PlatformStand == false then
  87.                             local confirm = Instance.new("IntValue")
  88.                             confirm.Parent = targhum
  89.                             confirm.Name = 'shot shell confirm - kry'
  90.                             debris:AddItem(confirm,0.1)
  91.                             if not op then
  92.                                 targhum.Health = targhum.Health - targhum.MaxHealth/2
  93.                             elseif op then
  94.                                 targhum.MaxHealth = 0
  95.                                 targhum.Health = 0
  96.                                 targhum.Parent:BreakJoints()
  97.                             end
  98.                             targhum.PlatformStand = true
  99.                             targhead.Velocity = (targhead.Position-p.Position).Unit * 50
  100.                             targhead.RotVelocity = Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30))
  101.                             wait(.1)
  102.                             targhum.PlatformStand = false
  103.                             --end
  104.                         else
  105.                             p.Velocity = p.Velocity + Vector3.new(0,75-p.Velocity.Y,0)
  106.                         end
  107.                     end
  108.                 end)
  109.             end)
  110.         end
  111.         wait(0)
  112.         if not rapid then
  113.             wait(.2)
  114.             makenoise("rbxassetid://254833653",han)
  115.             tween:Create(gun,TweenInfo.new(reloadwait),({Grip = gun.Grip * CFrame.fromEulerAnglesXYZ(-22.5,0,0)})):Play()
  116.             wait(reloadwait)
  117.             tween:Create(gun,TweenInfo.new(reloadwait),({Grip = gun.Grip - Vector3.new(0,0,-0.3)})):Play()
  118.             wait(reloadwait)
  119.         end
  120.         local s1 = Instance.new("Part",workspace)
  121.         s1.Shape = "Cylinder"
  122.         s1.Size = Vector3.new(.2,.1,.2)
  123.         s1.CFrame = han.CFrame*CFrame.new(0.15,.5,0)*CFrame.Angles(0,math.rad(90),0)
  124.         s1.Material = "Metal"
  125.         s1.BrickColor = BrickColor.new("Crimson")
  126.         local s2 = s1:Clone()
  127.         s2.Parent = workspace
  128.         s2.BrickColor = BrickColor.new("New Yeller")
  129.         s2.Size = Vector3.new(.05,.1,.1)
  130.         s2.CFrame = s1.CFrame*CFrame.new(-.125,0,0)
  131.         local wel = Instance.new("WeldConstraint",s1)
  132.         wel.Part0 = s1
  133.         wel.Part1 = s2
  134.         s1.RotVelocity = Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))
  135.         s1.Velocity = (s1.Position-han.Position).Unit * 20
  136.         if not rapid then
  137.             tween:Create(gun,TweenInfo.new(reloadwait),({Grip = gun.Grip - Vector3.new(0,0,0.3)})):Play()
  138.             wait(reloadwait)
  139.             tween:Create(gun,TweenInfo.new(reloadwait),({Grip = gun.Grip * CFrame.fromEulerAnglesXYZ(22.5,0,0)})):Play()
  140.             wait(reloadwait)
  141.         end
  142.         attacking = false
  143.     end
  144. end)
  145.  
  146. function CheckIfAlive()
  147.     local alive = false
  148.     if (plr and plr.Parent and char and char.Parent and hum and hum.Parent and hum.Health > 0 and torso and torso.Parent) then
  149.         alive = true
  150.     end
  151.     return alive
  152. end
  153.  
  154. gun.Equipped:Connect(function()
  155.     attacking = true
  156.     --makenoise("rbxassetid://" .. tostring(taunts[math.random(1,#taunts)]),han)
  157.     pcall(function()
  158.         char = gun.Parent
  159.         plr = game:GetService("Players"):GetPlayerFromCharacter(char)
  160.         hum = char:FindFirstChildOfClass("Humanoid")
  161.         torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart")
  162.         if not CheckIfAlive() then gun.Parent = nil return end
  163.     end)
  164.     for i = 0,15 do
  165.         gun.Grip = gun.Grip * CFrame.Angles(math.rad(-22.5),0,0)
  166.         wait(0)
  167.     end
  168.     if gun.Parent.ClassName == "Model" then
  169.         attacking = false
  170.     end
  171. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement