Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --AK47 by Protofer_S
- local Players = game:GetService("Players")
- local Player = owner
- local Tool = Instance.new("Tool") Tool.Name='AK47' Tool.CanBeDropped=false
- local Handle = Instance.new("Part",Tool) Handle.Size=Vector3.new(0.5, 0.99, 0.341) Handle.Name='Handle'
- local mesh = Instance.new("SpecialMesh",Handle) mesh.MeshId='rbxassetid://3824749' mesh.TextureId='rbxassetid://159740858' mesh.Scale=Vector3.new(2, 1.3, 1.1)
- 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)
- Tool.Parent=Player.Backpack
- tool = Tool
- local player = nil
- local remote = Instance.new("RemoteEvent",tool) remote.Name='hit'
- local pos = Vector3.new(0,0,0)
- local enabled=true
- local hitshot = Handle.CFrame
- script.Parent=Tool
- local run = game:GetService("RunService")
- local message
- local shooting
- function mouse()
- NLS([[local Tool = script.Parent
- local Player = game:GetService("Players").LocalPlayer
- local remote = Tool:WaitForChild('hit',5)
- local mouse = Player:GetMouse()
- local run = game:GetService("RunService")
- local shooting=false
- local enabled=false
- Tool.Equipped:Connect(function()
- enabled=true
- end)
- Tool.Unequipped:Connect(function()
- enabled=false
- end)
- mouse.Button1Down:connect(function(the)
- shooting=true
- end)
- mouse.Button1Up:connect(function(the)
- shooting=false
- end)
- run.RenderStepped:Connect(function()
- if shooting==true then
- if enabled==true then
- remote:FireServer(mouse.Hit.p,true)
- else
- remote:FireServer(mouse.Hit.p,false)
- end
- else
- remote:FireServer(mouse.Hit.p,false)
- end
- end)
- ]],tool)
- end
- function effect(vict)
- local headcf = vict
- for i = 1,5 do
- local bshpere2 = Instance.new("WedgePart",nil)
- bshpere2.Size = Vector3.new(math.random(2,6),math.random(2,6),0.03)
- bshpere2.Transparency = 1
- bshpere2.CanCollide = false
- bshpere2.Anchored = true
- local decal = Instance.new("Decal",bshpere2)
- decal.Texture = "rbxassetid://122022304"
- local decal2 = Instance.new("Decal",bshpere2)
- --decal2.Texture = "rbxassetid://122022304"
- --decal2.Face = Enum.NormalId.Back
- local dir = Vector3.new(math.random(-100,100),math.random(-100,100),math.random(-100,100)).Unit * 20
- local ray = Ray.new(headcf.Position,dir)
- local part,pos,normal = workspace:FindPartOnRay(ray,script.Parent,false,true)
- if part ~= nil then
- bshpere2.CFrame = CFrame.new(pos,pos + normal)
- bshpere2.Parent = workspace
- end
- game:GetService("Debris"):AddItem(bshpere2,10)
- end
- end
- function effect2(death)
- local BloodCount = 0
- local tor = death
- local MaxBlood = 10
- run.Heartbeat:Connect(function()
- if BloodCount < MaxBlood then
- BloodCount = BloodCount +1
- local blood1 = Instance.new("WedgePart")
- blood1.Color = Color3.new(0.666667, 0, 0)
- blood1.formFactor = 2
- blood1.Material=Enum.Material.Glass
- blood1.Transparency=.5
- blood1.Size = Vector3.new(0.3, 0.3, 0.3)
- blood1.BottomSurface = 1
- blood1.TopSurface = 1
- blood1.CFrame = tor.CFrame * CFrame.new(0,1,0)
- blood1.Name = "Blood"
- blood1.Parent = workspace
- --local Script1 = script.Script:clone()
- --Script1.Disabled = false
- --Script1.Parent = blood1
- local WaitTime = 1
- game:GetService("Debris"):AddItem(blood1,10)
- if WaitTime == 1 then
- wait()
- end
- end
- if BloodCount == MaxBlood then
- return end
- end)
- end
- Tool.Equipped:Connect(function()
- wait()
- Player = Players:GetPlayerFromCharacter(Tool.Parent)
- enabled=true
- end)
- Tool.Unequipped:Connect(function()
- enabled=false
- end)
- mouse()
- function killhumanoid(hum)
- coroutine.resume(coroutine.create(function()
- while true do wait()
- if hum:IsDescendantOf(workspace) then
- hum.Health=0
- else
- break
- end
- end
- end))
- end
- remote.OnServerEvent:Connect(function(m,mess,shot)
- message=mess shooting=shot
- end)
- function bullet()
- coroutine.resume(coroutine.create(function()
- pcall(function()
- local pos = Handle.CFrame * CFrame.new(.1,.55,0)
- 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'
- local M = Instance.new("SpecialMesh",bull) M.MeshId='rbxassetid://7191976822' M.Scale=Vector3.new(0.45, 0.65, 0.65)
- bull.CFrame=pos*CFrame.Angles(0,math.rad(-90),0)
- bull.Velocity = Vector3.new(math.random(0,3)*3,math.random(-1,1)*3,math.random(-2,2)*3)
- wait(1)
- bull:Destroy()
- end)
- end))
- end
- run.Heartbeat:Connect(function()
- if shooting==true then
- local Humanoid = Player.Character:FindFirstChildOfClass('Humanoid')
- if Humanoid then
- pos=message
- if enabled==true then
- enabled=false
- local shot = Handle:FindFirstChild('shot') if shot then
- shot.TimePosition=.1
- shot.Volume=math.random(2,5)
- shot:Play()
- else
- shot = Instance.new("Sound",Handle) shot.TimePosition=.1 shot.SoundId='rbxassetid://6154490497' shot.Name='shot' shot.Volume=2 shot:Play()
- end
- hitshot = Handle.CFrame * CFrame.new(0,.39,-2)
- if Humanoid.Health > 0 then
- local ray = Ray.new(hitshot.p, (pos - hitshot.p).unit * 600)
- local part, position = workspace:FindPartOnRay(ray, Player.Character, false, true)
- local beam = Instance.new("WedgePart", workspace)
- beam.BrickColor = BrickColor.new("Cool yellow")--player.TeamColor
- beam.Material = Enum.Material.Neon
- beam.Transparency = .3
- beam.Anchored = true
- beam.Locked = true
- beam.CanCollide = false
- bullet()
- local distance = (hitshot.p - position).magnitude
- beam.Size = Vector3.new(.05, .05, distance)
- beam.CFrame = CFrame.new(hitshot.p, position)*CFrame.new(0, 0, -distance / 2)
- game:GetService("Debris"):AddItem(beam,0.1)
- if part then
- if part.Name=='Handle' then
- part.Anchored=false
- part:BreakJoints()
- part.Velocity = Vector3.new(math.random(-5,5)*10,math.random(-5,5)*10,math.random(-5,5)*10)
- part.CanCollide=false
- end
- local humanoid = part.Parent:FindFirstChildOfClass("Humanoid")
- if not humanoid then
- humanoid = part.Parent.Parent:FindFirstChildOfClass("Humanoid")
- end
- if humanoid then
- if humanoid.Health>9e9 then humanoid.Health=0 killhumanoid(humanoid)
- for i,v in pairs(part.Parent:GetDescendants()) do
- if v:IsA("Constraint") or v:IsA("Attachment") or v:IsA("Weld") then v:Destroy()end
- if v:IsA("BasePart") or v:IsA("FlagStand") then
- v.Anchored=false
- v:BreakJoints()
- end
- end
- else
- humanoid.Health=humanoid.Health-math.random(9,20)
- end
- end
- if part.Name=='Head' then
- effect2(part)
- local gore = Instance.new("Sound",part) gore.SoundId='rbxassetid://429400881' gore.Volume=.7 gore.PlayOnRemove=true gore:Play()
- part:BreakJoints() part.Color=Color3.new(0.666667, 0, 0) --part.Name='dead'
- for i,v in pairs(part.Parent:GetDescendants()) do
- if v:IsA("BasePart") then
- v.Anchored=false
- v:BreakJoints()
- if v.Name=='Torso' then
- end
- end
- end
- --[[
- if humanoid then
- if humanoid.Health>0.1 then
- end
- end
- effect(part)
- ]]
- local ded = part:FindFirstChildOfClass('Decal')
- if ded then
- ded.Texture='http://www.roblox.com/asset/?id=860143307'
- else
- ded = Instance.new("Decal",ded) ded.Texture='http://www.roblox.com/asset/?id=860143307'
- end
- --[[
- local effect = Instance.new("ParticleEmitter",part)
- effect.Color=ColorSequence.new(Color3.new(0.666667, 0, 0))
- 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)
- effect.Lifetime=NumberRange.new(1,2)
- effect.EmissionDirection=Enum.NormalId.Bottom effect.Enabled=true effect.Rate=100 effect.Speed=NumberRange.new(4, 4) effect.SpreadAngle=Vector2.new(10,10)
- wait(.5)
- effect:Destroy()
- ]]
- wait()
- part:Destroy()
- end
- end
- end
- wait(.04)
- enabled=true
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement