Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- player = game:service("Players").LocalPlayer
- workspace = game:service("Workspace")
- char = player.Character
- mouse = player:GetMouse()
- equip = false
- cooldown = true
- aim = false
- ammo = 7
- reload = true
- rootpart = char:FindFirstChild("HumanoidRootPart")
- body = ""
- local bg = Instance.new("BodyGyro", script)
- bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
- bg.P = 10000
- bg.D = 100
- if char:FindFirstChild("Torso") then
- body = char.Torso
- elseif char:FindFirstChild("UpperTorso") then
- body = char.UpperTorso
- end
- function blood(parent)
- local blood = Instance.new("ParticleEmitter", parent)
- blood.Color = ColorSequence.new(Color3.new(1, 0, 0), Color3.new(0.5, 0, 0))
- blood.LightEmission = 0.1
- blood.Size = NumberSequence.new(0.07)
- blood.Texture = "http://www.roblox.com/asset/?ID=771221224"
- blood1 = NumberSequence.new({
- NumberSequenceKeypoint.new(0, 0.2),
- NumberSequenceKeypoint.new(1, 5)
- })
- blood2 = NumberSequence.new({
- NumberSequenceKeypoint.new(0, 1),
- NumberSequenceKeypoint.new(0.0636, 0),
- NumberSequenceKeypoint.new(1, 1)
- })
- blood.Transparency = blood2
- blood.Size = blood1
- blood.ZOffset = 0.9
- blood.Acceleration = Vector3.new(0, -2, 0)
- blood.LockedToPart = false
- blood.EmissionDirection = "Top"
- blood.Lifetime = NumberRange.new(0.5, 0.6)
- blood.Rate = 1000
- blood.Rotation = NumberRange.new(-100, 100)
- blood.RotSpeed = NumberRange.new(-100, 100)
- blood.Speed = NumberRange.new(10)
- blood.VelocitySpread = 30
- blood.Enabled = true
- wait(0.03)
- blood.Enabled = false
- end
- t1 = Instance.new("Tool", player.Backpack)
- t1.GripUp = Vector3.new(0, 0, 1)
- t1.GripPos = Vector3.new(0, -0.2, -0.5)
- t1.Name = ""
- p1 = Instance.new("Part", t1)
- p1.BrickColor = BrickColor.new("Black")
- p1.Name = "Handle"
- p1.CFrame = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(5), math.rad(5), math.rad(5))
- p1.Size = Vector3.new(0.2, 1.2, 0.7)
- p1.BottomSurface = Enum.SurfaceType.Smooth
- p1.TopSurface = Enum.SurfaceType.Smooth
- b1 = Instance.new("SpecialMesh", p1)
- b1.MeshId = "http://www.roblox.com/asset/?id=72012879"
- b1.TextureId = "http://www.roblox.com/asset/?id=150098265"
- b1.MeshType = Enum.MeshType.FileMesh
- b1.Name = "Mesh"
- b1.Offset = Vector3.new(0, 0.300000012, -0.150000006)
- b1.Scale = Vector3.new(2, 1.5, 1.25)
- p2 = Instance.new("Part", t1)
- p2.BrickColor = BrickColor.new("Black")
- p2.Transparency = 1
- p2.Name = "Main"
- p2.CFrame = CFrame.new(-9.07499886, 4.39000416, -19.8000011, 1, 2.22369144E-5, 1.3722377E-8, -2.22369144E-5, 1, -1.43634118E-8, -1.37226968E-8, 1.43631063E-8, 1)
- p2.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
- p2.BottomSurface = Enum.SurfaceType.Smooth
- p2.TopSurface = Enum.SurfaceType.Smooth
- Weld = Instance.new("Weld", char)
- Weld.Part0 = p1
- Weld.Part1 = p2
- Weld.C1 = CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
- function fx()
- local blood = Instance.new("ParticleEmitter", p1)
- blood.Color = ColorSequence.new(Color3.new(255, 255, 255), Color3.new(255, 255, 255))
- blood.LightEmission = 0.1
- blood.Size = NumberSequence.new(0, 0, 0)
- blood.Texture = "http://www.roblox.com/asset/?id=242995654"
- blood1 = NumberSequence.new({
- NumberSequenceKeypoint.new(0, 0.2),
- NumberSequenceKeypoint.new(1, 5)
- })
- blood2 = NumberSequence.new({
- NumberSequenceKeypoint.new(0, 1),
- NumberSequenceKeypoint.new(0.0636, 0),
- NumberSequenceKeypoint.new(1, 1)
- })
- blood.Transparency = blood2
- blood.Size = blood1
- blood.ZOffset = 0.9
- blood.Acceleration = Vector3.new(0, -2, 0)
- blood.LockedToPart = true
- blood.EmissionDirection = "Top"
- blood.Lifetime = NumberRange.new(0.1, 0.1)
- blood.Rate = 100
- blood.Rotation = NumberRange.new(-100, 100)
- blood.RotSpeed = NumberRange.new(-100, 100)
- blood.Speed = NumberRange.new(10)
- blood.VelocitySpread = 30
- blood.Enabled = true
- wait(0.03)
- blood:Destroy()
- end
- Tool = t1
- local arms, torso
- local welds = {}
- function Equip(mouse)
- bg.Parent = rootpart
- aim = true
- wait(0.01)
- arms = {
- Tool.Parent:FindFirstChild("Left Arm"),
- Tool.Parent:FindFirstChild("Right Arm")
- }
- torso = Tool.Parent:FindFirstChild("Torso")
- if arms ~= nil and torso ~= nil then
- local sh = {
- torso:FindFirstChild("Left Shoulder"),
- torso:FindFirstChild("Right Shoulder")
- }
- if sh ~= nil then
- local yes = true
- if yes then
- yes = false
- sh[1].Part1 = nil
- sh[2].Part1 = nil
- local weld1 = Instance.new("Weld")
- weld1.Part0 = torso
- weld1.Parent = torso
- weld1.Part1 = arms[1]
- weld1.C1 = CFrame.new(-0.249, 0.1, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(320), 0, math.rad(-90))
- welds[1] = weld1
- local weld2 = Instance.new("Weld")
- weld2.Part0 = torso
- weld2.Parent = torso
- weld2.Part1 = arms[2]
- weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
- welds[2] = weld2
- end
- else
- print("sh")
- end
- else
- print("arms")
- end
- end
- function Unequip(mouse)
- bg.Parent = script
- aim = false
- if arms ~= nil and torso ~= nil then
- local sh = {
- torso:FindFirstChild("Left Shoulder"),
- torso:FindFirstChild("Right Shoulder")
- }
- if sh ~= nil then
- local yes = true
- if yes then
- yes = false
- sh[1].Part1 = arms[1]
- sh[2].Part1 = arms[2]
- welds[1].Parent = nil
- welds[2].Parent = nil
- end
- else
- print("sh")
- end
- else
- print("arms")
- end
- end
- Tool.Equipped:connect(Equip)
- Tool.Unequipped:connect(Unequip)
- local tool = t1
- tool.Equipped:connect(function(mouse)
- equip = true
- mouse.Button1Down:connect(function()
- if reload then
- ammo = ammo - 1
- body.CFrame = CFrame.new(body.Position, mouse.Hit.p)
- sou = Instance.new("Sound", p1)
- sou.Volume = 2
- sou.SoundId = "rbxassetid://930650202"
- sou:Play()
- fx()
- if mouse.Target.Parent:FindFirstChildOfClass("Humanoid") then
- if mouse.Target.Parent.Humanoid.Health ~= 0 then
- local target = mouse.Target
- blood(target)
- sou = Instance.new("Sound", target)
- sou.Volume = 1.3
- sou.SoundId = "rbxassetid://144884872"
- sou:Play()
- target.Parent.Humanoid:TakeDamage(math.random(target.Parent.Humanoid.MaxHealth / 2 / 3, target.Parent.Humanoid.MaxHealth / 2 / 2))
- elseif mouse.Target.Parent:FindFirstChildOfClass("Humanoid") and mouse.Target.Parent:FindFirstChild("Head") then
- local target = mouse.Target
- target.Parent:BreakJoints()
- local bv = Instance.new("BodyVelocity")
- bv.maxForce = Vector3.new(1000000000, 1000000000, 1000000000)
- bv.velocity = mouse.Hit.lookVector * 45
- bv.Parent = target.Parent.Head
- end
- end
- end
- end)
- end)
- while wait() do
- if ammo == 0 and reload then
- reload = false
- sou = Instance.new("Sound", p1)
- sou.Volume = 1.3
- sou.SoundId = "rbxassetid://174295321"
- sou:Play()
- wait(2)
- ammo = 7
- reload = true
- end
- if aim then
- bg.cframe = CFrame.new(rootpart.Position, mouse.Hit.p * Vector3.new(1, 0, 1) + rootpart.Position * Vector3.new(0, 1, 0))
- end
- end
Advertisement
Advertisement