Advertisement
Prephy

crazy ak47

Nov 4th, 2021 (edited)
1,577
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.49 KB | None | 0 0
  1. --AK47 by Protofer_S
  2. --Banish ak47 confirmed!?!? 😳😳😳😳
  3. local Players = game:GetService("Players")
  4. local Player = owner
  5. local Tool = Instance.new("Tool") Tool.Name='AK47' Tool.CanBeDropped=false
  6. local Handle = Instance.new("Part",Tool) Handle.Size=Vector3.new(0.5, 0.99, 0.341) Handle.Name='Handle'
  7. local mesh = Instance.new("SpecialMesh",Handle) mesh.MeshId='rbxassetid://3824749' mesh.TextureId='rbxassetid://159740858' mesh.Scale=Vector3.new(2, 1.3, 1.1)
  8. Tool.GripForward=Vector3.new(0, 0, -1) Tool.GripPos=Vector3.new(0, -0.2, 0.8) Tool.GripRight=Vector3.new(1, 0, 0) Tool.GripUp=Vector3.new(0, 1, 0)
  9.  
  10. Tool.Parent=Player.Backpack
  11. tool = Tool
  12. local player = nil
  13. local remote = Instance.new("RemoteEvent",tool) remote.Name='hit'
  14. local pos = Vector3.new(0,0,0)
  15. local enabled=true
  16. local hitshot = Handle.CFrame
  17. script.Parent=Tool
  18. local run = game:GetService("RunService")
  19. local message
  20. local shooting
  21. local beamlook
  22.  
  23.  
  24.  
  25.  
  26. Frame_Speed = 1 / 60
  27. ArtificialHB = Instance.new("BindableEvent")
  28. frame = Frame_Speed
  29. tf = 0
  30. allowframeloss = false
  31. tossremainder = false
  32. lastframe = tick()
  33. ArtificialHB:Fire()
  34. run.Heartbeat:connect(function(s, p)
  35.     tf = tf + s
  36.     if tf >= frame then
  37.         if allowframeloss then
  38.             ArtificialHB:Fire()
  39.             lastframe = tick()
  40.         else
  41.             for i = 1, math.floor(tf / frame) do
  42.                 ArtificialHB:Fire()
  43.             end
  44.             lastframe = tick()
  45.         end
  46.         if tossremainder then
  47.             tf = 0
  48.         else
  49.             tf = tf - frame * math.floor(tf / frame)
  50.         end
  51.     end
  52. end)
  53.  
  54. function mouse()
  55.     NLS([[local Tool = script.Parent
  56. local Player = game:GetService("Players").LocalPlayer
  57. local remote = Tool:WaitForChild('hit',5)
  58. local mouse = Player:GetMouse()
  59. local run = game:GetService("RunService")
  60. local shooting=false
  61. local enabled=false
  62.  
  63. Tool.Equipped:Connect(function()
  64. enabled=true
  65. end)
  66.  
  67. Tool.Unequipped:Connect(function()
  68. enabled=false
  69. end)
  70.  
  71. mouse.Button1Down:connect(function(the)
  72.  
  73.     shooting=true
  74.  
  75. end)
  76.  
  77. mouse.Button1Up:connect(function(the)
  78.  
  79.     shooting=false
  80.  
  81. end)
  82.  
  83.  
  84.  
  85. run.RenderStepped:Connect(function()
  86.     if shooting==true then
  87.      if enabled==true then
  88.             remote:FireServer(mouse.Hit.p,true)
  89.         else
  90.             remote:FireServer(mouse.Hit.p,false)
  91.         end
  92.     else
  93.         remote:FireServer(mouse.Hit.p,false)
  94.     end
  95. end)
  96.  
  97.  
  98. ]],tool)
  99. end
  100.  
  101.  
  102. function effect(vict)
  103.     local headcf = vict
  104.     for i = 1,5 do
  105.         local bshpere2 = Instance.new("WedgePart",nil)
  106.         bshpere2.Size = Vector3.new(math.random(2,6),math.random(2,6),0.03)
  107.         bshpere2.Transparency = 1
  108.         bshpere2.CanCollide = false
  109.         bshpere2.Anchored = true
  110.         local dir = Vector3.new(math.random(-100,100),math.random(-100,100),math.random(-100,100)).Unit * 20
  111.         local ray = Ray.new(headcf.Position,dir)
  112.         local part,pos,normal = workspace:FindPartOnRay(ray,script.Parent,false,true)
  113.         if part ~= nil then
  114.             bshpere2.CFrame = CFrame.new(pos,pos + normal)
  115.             bshpere2.Parent = workspace
  116.         end
  117.         game:GetService("Debris"):AddItem(bshpere2,10)
  118.     end
  119. end
  120.  
  121. function effect2(death)
  122.     local BloodCount = 0
  123.     local tor = death
  124.     local MaxBlood = 10
  125.     run.Heartbeat:Connect(function()
  126.         if BloodCount < MaxBlood then
  127.             BloodCount = BloodCount +1
  128.             local blood1 = Instance.new("WedgePart")
  129.             blood1.Color = Color3.new(0.666667, 0, 0)
  130.             blood1.formFactor = 2
  131.             blood1.Material=Enum.Material.Glass
  132.             blood1.Transparency=.5
  133.             blood1.Size = Vector3.new(0.3, 0.3, 0.3)
  134.             blood1.BottomSurface = 1
  135.             blood1.TopSurface = 1
  136.             blood1.CFrame = tor.CFrame * CFrame.new(0,1,0)
  137.             blood1.Name = "Blood"
  138.             blood1.Parent = workspace
  139.             --local Script1 = script.Script:clone()
  140.             --Script1.Disabled = false
  141.             --Script1.Parent = blood1
  142.             local WaitTime = 1
  143.             game:GetService("Debris"):AddItem(blood1,10)
  144.             if WaitTime == 1 then
  145.                 wait()
  146.             end
  147.         end
  148.         if BloodCount == MaxBlood then
  149.             return end
  150.     end)
  151. end
  152.  
  153. Tool.Equipped:Connect(function()
  154.     wait()
  155.     Player = Players:GetPlayerFromCharacter(Tool.Parent)
  156.     enabled=true
  157. end)
  158.  
  159. Tool.Unequipped:Connect(function()
  160.     enabled=false
  161. end)
  162.  
  163. mouse()
  164.  
  165. function killhumanoid(hum)
  166.     coroutine.resume(coroutine.create(function()
  167.         while true do wait()
  168.             if hum:IsDescendantOf(workspace) then
  169.                 hum.Health=0
  170.             else
  171.                 break
  172.             end
  173.         end
  174.     end))
  175.  
  176. end
  177.  
  178. remote.OnServerEvent:Connect(function(m,mess,shot)
  179.     message=mess shooting=shot
  180. end)
  181. function bullet()
  182.     coroutine.resume(coroutine.create(function()
  183.         pcall(function()
  184.             local pos = Handle.CFrame * CFrame.new(.1,.55,0)
  185.             local bull = Instance.new("SpawnLocation") bull.CanCollide=false bull.Enabled=false bull.Neutral=false  bull.Massless=true bull.Color=Color3.new(1, 0.666667, 0) bull.Parent=tool bull.Size=Vector3.new(.3,.2,.2) bull.Name='Shell'
  186.             local M = Instance.new("SpecialMesh",bull) M.MeshId='rbxassetid://7191976822' M.Scale=Vector3.new(0.45, 0.65, 0.65)
  187.             bull.CFrame=pos*CFrame.Angles(0,math.rad(-90),0)
  188.             bull.Velocity = Vector3.new(math.random(0,3)*3,math.random(-1,1)*3,math.random(-2,2)*3)
  189.             wait(1)
  190.             bull:Destroy()
  191.         end)
  192.     end))
  193. end
  194.  
  195. ArtificialHB.Event:Connect(function()
  196.     if shooting==true then
  197.         local Humanoid = Player.Character:FindFirstChildOfClass('Humanoid')
  198.         if Humanoid then
  199.         local mytorso = Player.Character:FindFirstChild("Torso")
  200.             pos=message
  201.             if enabled==true then
  202.                 --enabled=false
  203.                 local shot = Handle:FindFirstChild('shot') if shot then
  204.                     shot.TimePosition=.1
  205.                     shot.Volume=4
  206.                     shot:Play()
  207.                 else
  208.                     shot = Instance.new("Sound",Handle) shot.TimePosition=.1 shot.SoundId='rbxassetid://6154490497' shot.Name='shot' shot.Volume=8 shot:Play()
  209.                 end
  210.  
  211.                 hitshot = Handle.CFrame * CFrame.new(0,.39,-2)
  212.                 if Humanoid.Health > 0 then
  213.                     local ray = Ray.new(hitshot.p, (pos - hitshot.p).unit * 600)
  214.                     local part, position = workspace:FindPartOnRay(ray, Player.Character, false, true)
  215.                     local beam = Instance.new("WedgePart", workspace)
  216.                     beam.BrickColor =  BrickColor.new("Cool yellow")--player.TeamColor
  217.                     beam.Material = Enum.Material.Neon
  218.                     beam.Transparency = .3
  219.                     beam.Anchored = true
  220.                     beam.Locked = true
  221.                     beam.CanCollide = false
  222.                     --bullet()
  223.                     local distance = (hitshot.p - position).magnitude
  224.                     beam.Size = Vector3.new(.05, .05, distance)
  225.                     beam.CFrame = CFrame.new(hitshot.p, position)*CFrame.new(0, 0, -distance / 2)
  226.                     beamlook = beam.CFrame.lookVector
  227.                     game:GetService("Debris"):AddItem(beam,0.1)
  228.  
  229.                     if part then
  230.  
  231.                         if part.Name=='Handle' then
  232.                             part.Anchored=false
  233.                             part:BreakJoints()
  234.                             part.Velocity = beamlook*10
  235.                             part.CanCollide=false
  236.                         end
  237.                         local humanoid = part.Parent:FindFirstChildOfClass("Humanoid")
  238.                         if not humanoid then
  239.                             humanoid = part.Parent.Parent:FindFirstChildOfClass("Humanoid")
  240.                         end
  241.  
  242.                         if humanoid then
  243.                             if humanoid.Health>99 then humanoid.Health=0 killhumanoid(humanoid)
  244.                                 for i,v in pairs(part.Parent:GetDescendants()) do
  245.                                     if v:IsA("Constraint") or v:IsA("Attachment") or v:IsA("Weld") then v:Destroy()end
  246.                                     if v:IsA("BasePart") or v:IsA("FlagStand") then
  247.                                         v.Anchored=false
  248.                                         v:BreakJoints()
  249.                                     end
  250.                                 end
  251.                             else
  252.                                 humanoid.Health=humanoid.Health-math.random(9,40)
  253.                             end
  254.                         end
  255.                         if part.Name=='Head' then
  256.                  
  257.                         pcall(function()  part:BreakJoints()  part.Velocity = beamlook*20 end)
  258.                             for i,v in pairs(part.Parent:GetDescendants()) do
  259.                                 if v:IsA("BasePart") then
  260.                                     v.Anchored=false
  261.                                     v:BreakJoints()
  262.                                     if v.Name=='Torso' then
  263.  
  264.                                     end
  265.                                 end
  266.                             end
  267.  
  268.                         --[[
  269.                         if humanoid then
  270.                             if humanoid.Health>0.1 then
  271.                             end
  272.                         end
  273.                         effect(part)
  274.                         ]]
  275.  
  276.                            
  277.                     --[[
  278.                     local effect = Instance.new("ParticleEmitter",part)
  279.                     effect.Color=ColorSequence.new(Color3.new(0.666667, 0, 0))
  280.                     effect.Size=NumberSequence.new(0,0.7) effect.Texture='http://www.roblox.com/asset/?id=243457340' effect.Orientation=Enum.ParticleOrientation.FacingCamera effect.Acceleration=Vector3.new(0,-1.5,0)
  281.                     effect.Lifetime=NumberRange.new(1,2)
  282.                     effect.EmissionDirection=Enum.NormalId.Bottom   effect.Enabled=true effect.Rate=100 effect.Speed=NumberRange.new(4, 4)  effect.SpreadAngle=Vector2.new(10,10)
  283.                
  284.                     wait(.5)
  285.                     effect:Destroy()
  286.                     ]]
  287.                             --wait()
  288.                             --part:Destroy()
  289.                         end
  290.                     end
  291.  
  292.  
  293.  
  294.                 end
  295. --ArtificialHB.Event:Wait()
  296.             --enabled=true
  297.             end
  298.         end
  299.     end
  300. end)
  301.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement