NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

wait(0.5)
--Made by FlaminMetal--
local Tool = script.Parent
local Settings = {
Range = 1000
,Spread = 10
,Damage = {25, 50}
,HeadShotDamage = {70, 120}
,Bullets = 1
,FireRate = 0.1
,Automatic = true
,AntiTK = true
,ImpactDuration = 3
--Reload
,ReloadKey = "R"
,ReloadTime = 2.5
,Ammo = 30
,IncludeChamberedBullet = true
--Gui
,GuiPos = Vector2.new(script.Gui.Frame.Position.X.Scale, script.Gui.Frame.Position.Y.Scale)
--Arms
,OneHanded = false
,FakeArms = true
,FakeArmTransparency = 0.5
,RightPos = CFrame.new(-0.75, -0.25, 0.5) * CFrame.Angles(math.rad(-90), 0, 0)
,LeftPos = CFrame.new(1, 0.5, 0.5) * CFrame.Angles(math.rad(-90), math.rad(45), 0)
,AimPart = Tool.AimPart
,AimPartOffset = CFrame.new()
,AimGripOffset = Vector3.new(0, 0, 0)
,LeftAimPos = CFrame.new(1, 0.5, 0.5) * CFrame.Angles(math.rad(-100), math.rad(45), 0)
,AimAnim = {
Enabled = false
,Frames = 50
,Time = 0.1
}
,ChangeFOV = {true, 60}
,SpreadReduction = 5
--Weld
,Weld = true
--Mouse
,Icons = {
Idle = "rbxassetid://70288585"
,Fire1 = "rbxassetid://70288578"
,Fire2 = "rbxassetid://70288572"
,Fire3 = "rbxassetid://70288578"
,Reload = "rbxassetid://70288599"
,Aim = "rbxasset://textures/Blank.png"
}
,FireMouseAnimTime = 0.15
--Recoil
,Recoil = math.rad(1)
--Smoke
,Smoke = true
,SmokePart = Tool.SmokePart
,Smokes = {{script.Smoke, 6, 0.1}, {script.Smoke1, 0.1}, {script.Smoke1, 0.1}, {script.Flash, 0.03}}
--Sprint
,Sprint = true
,SprintSpeed = 25
,SprintKey = "0"
,SprintSpreadIncrease = 40
,SprintArmOffset = CFrame.new(0.25, 0.125, 0.25) * CFrame.Angles(math.rad(-30), math.rad(35), 0)
--Other
,DropHats = true
}



local Orig_Spread = Settings.Spread
local Orig_Grip = Tool.GripPos

local Player = game.Players.LocalPlayer
local Character = Player.Character

local Camera = Workspace.CurrentCamera

local Ammo, StoredAmmo = script.Ammo, script.StoredAmmo

local Gui, CanUpdateGui = nil, true

local Sprinting, Equipped

function Update_Gui()
if Gui and CanUpdateGui then
Gui.Frame.AmmoDisplay.Text = Ammo.Value .. "|" .. StoredAmmo.Value
end
end

local Welded
if Settings.Weld then
Delay(0, function()
local weldC0s = {}
for i, v in pairs(Tool:GetChildren()) do
if v:IsA("BasePart") and v ~= Tool.Handle then
table.insert(weldC0s, {v, Tool.Handle.CFrame:toObjectSpace(v.CFrame)})
v.Anchored = false
end
end
Tool.Handle.Anchored = false
local welds = {}
Tool.Equipped:connect(function()
for i, v in ipairs(welds) do
v.Part1 = nil
v:Destroy()
end
for i, v in ipairs(weldC0s) do
if v[1] and v[2] then
local w = Instance.new("Weld", Tool.Handle)
w.Part0 = Tool.Handle
w.Part1 = v[1]
w.C0 = v[2]
table.insert(welds, w)
end
end
end)
wait()
Welded = true
end)
end

local Left_Weld, Right_Weld

Ammo.Changed:connect(Update_Gui)
StoredAmmo.Changed:connect(Update_Gui)

Settings.Range = math.min(Settings.Range, 999)

local Ignore_Model = Workspace:FindFirstChild("Ray_Ignore") or Instance.new("Model", Workspace)
Ignore_Model.Name = "Ray_Ignore"

local Ray_Ignore = {Character, Ignore_Model, Camera}

Character.Humanoid.Died:connect(function()
Tool.Parent = Player.Backpack
end)

function Fire(Mouse)
local Spread = CFrame.Angles(math.rad(math.random(-Settings.Spread, Settings.Spread)/10), math.rad(math.random(-Settings.Spread, Settings.Spread)/10), math.rad(math.random(-Settings.Spread, Settings.Spread)/10))
local Ray = Ray.new(Character.Head.Position, (CFrame.new(Character.Head.Position, Mouse.Hit.p) * Spread).lookVector.unit * Settings.Range)
local Hit, Pos = Workspace:FindPartOnRayWithIgnoreList(Ray, Ray_Ignore)
if Hit and Hit.Parent:FindFirstChild("Humanoid") then
local Hit_Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
if Settings.AntiTK and not Hit_Player.Neutral and Hit_Player.TeamColor == Player.TeamColor then
return
end
local Humanoid = Hit.Parent.Humanoid
local c = Instance.new("ObjectValue")
c.Name = "creator"
c.Value = Player
game.Debris:AddItem(c, 3)
c.Parent = Humanoid
if Hit.Name == "Head" then
Humanoid.Health = Humanoid.Health - math.random(Settings.HeadShotDamage[1], Settings.HeadShotDamage[2])
else
Humanoid.Health = Humanoid.Health - math.random(Settings.Damage[1], Settings.Damage[2])
end
elseif Hit then
local Hit_Part = Instance.new("Part", Ignore_Model)
Hit_Part.FormFactor = "Custom"
Hit_Part.TopSurface = 0
Hit_Part.BottomSurface = 0
Hit_Part.Anchored = true
Hit_Part.CanCollide = false
Hit_Part.Size = Vector3.new()
Hit_Part.CFrame = CFrame.new(Pos) * CFrame.Angles(math.random(0, 360), math.random(0, 360), math.random(0, 360))
Hit_Part.BrickColor = BrickColor.new("Black")
game.Debris:AddItem(Hit_Part, Settings.ImpactDuration)
if not Hit.Anchored then
local w = Instance.new("Weld", Hit_Part)
w.Part0 = Hit
w.Part1 = Hit_Part
w.C0 = Hit.CFrame:toObjectSpace(Hit_Part.CFrame)
Hit_Part.Anchored = false
end
if Hit.Parent:IsA("Hat") and Settings.DropHats then
Hit.Parent.Parent = workspace
game.Debris:AddItem(Hit, 3)
end
end
end

local Can_Shoot = true
local Reloading = false

local First_Person = false

local Mouse_Held

Tool.Equipped:connect(function(Mouse)
Equipped = true
if Settings.Weld and not Welded then
wait()
Tool.Parent = Player.Backpack
end
Character = Player.Character
if Gui then
return
end
Ray_Ignore = {Character, Ignore_Model, Camera}
Mouse.Icon = Settings.Icons.Idle
Gui = script.Gui:Clone()
Gui.Parent = Player.PlayerGui
Gui.Frame.Position = UDim2.new(Settings.GuiPos.X, Gui.Frame.Position.X.Offset, 1.1, Gui.Frame.Position.Y.Offset)
Gui.Frame:TweenPosition(UDim2.new(Settings.GuiPos.X, Gui.Frame.Position.X.Offset, Settings.GuiPos.Y, Gui.Frame.Position.Y.Offset), "Out", "Bounce", 1)
CanUpdateGui = true
Update_Gui()
Mouse.Button1Down:connect(function()
if Can_Shoot and Ammo.Value > 0 and Character.Humanoid.Health > 0 then
Mouse_Held = true
while true do
Can_Shoot = false
Delay(0, function()
local t = math.min(Settings.FireMouseAnimTime/3, Settings.FireRate/3)
if not Aiming then
Mouse.Icon = Settings.Icons.Fire1
end
wait(t)
if not Aiming then
if Reloading then return end
Mouse.Icon = Settings.Icons.Fire2
end
wait(t)
if not Aiming then
if Reloading then return end
Mouse.Icon = Settings.Icons.Fire3
end
wait(t)
if not Aiming then
if Reloading then return end
Mouse.Icon = Settings.Icons.Idle
end
end)
if Settings.Smoke then
for i, v in pairs(Settings.Smokes) do
local s = v[1]:Clone()
s.Parent = Settings.SmokePart
s.Enabled = true
game.Debris:AddItem(s, v[2])
if v[3] then
Delay(v[3], function()
s.Enabled = false
end)
end
end
end
for _ = 1, Settings.Bullets do
pcall(function() Fire(Mouse) end)
end
Camera.CoordinateFrame = CFrame.new(Camera.Focus.p) * (Camera.CoordinateFrame - Camera.CoordinateFrame.p) * CFrame.Angles(math.abs(Settings.Recoil), 0, 0) * CFrame.new(0, 0, (Camera.Focus.p - Camera.CoordinateFrame.p).magnitude)
if Tool.Handle:FindFirstChild("Shoot") then
Tool.Handle.Shoot:Play()
end
Ammo.Value = Ammo.Value - 1
wait(Settings.FireRate)
if not Settings.Automatic or Ammo.Value <= 0 or Character.Humanoid.Health <= 0 or not Mouse_Held then
break
end
end
Can_Shoot = true
elseif Can_Shoot and Character.Humanoid.Health > 0 and Tool.Handle:FindFirstChild("Click") then
Tool.Handle.Click:Play()
end
end)
Mouse.Button1Up:connect(function()
Mouse_Held = false
end)
Mouse.KeyDown:connect(function(Key)
if Key:upper() == Settings.ReloadKey:upper() and Can_Shoot and StoredAmmo.Value > 0 and not Aiming then
if Settings.IncludeChamberedBullet and Ammo.Value == Settings.Ammo + 1 or not Settings.IncludeChamberedBullet and Ammo.Value == Settings.Ammo then
return
end
Can_Shoot = false
Reloading = true
local TextLabel = Gui.Frame.AmmoDisplay
Delay(0, function()
CanUpdateGui = false
TextLabel.Text = "Reloading."
wait(Settings.ReloadTime/3)
if TextLabel then
TextLabel.Text = "Reloading.."
end
wait(Settings.ReloadTime/3)
if TextLabel then
TextLabel.Text = "Reloading..."
end
end)
if Tool.Handle:FindFirstChild("Reload") then
Tool.Handle.Reload:Play()
end
Mouse.Icon = Settings.Icons.Reload
wait(Settings.ReloadTime)
Mouse.Icon = Settings.Icons.Idle
CanUpdateGui = true
local m = Settings.Ammo
if Ammo.Value > 0 and Settings.IncludeChamberedBullet then
m = m + 1
end
if (StoredAmmo.Value - (m - Ammo.Value)) <= 0 then
Ammo.Value = Ammo.Value + StoredAmmo.Value
StoredAmmo.Value = 0
else
StoredAmmo.Value = StoredAmmo.Value - (m - Ammo.Value)
Ammo.Value = m
end
Can_Shoot = true
Reloading = false
elseif Key:upper() == Settings.SprintKey:upper() and Settings.Sprint and not Aiming then
Sprinting = true
Character.Humanoid.WalkSpeed = Settings.SprintSpeed
Settings.Spread = Settings.Spread + Settings.SprintSpreadIncrease
end
end)
Mouse.KeyUp:connect(function(Key)
if Key:upper() == Settings.SprintKey:upper() and Sprinting then
Sprinting = false
Character.Humanoid.WalkSpeed = 16
Settings.Spread = Settings.Spread - Settings.SprintSpreadIncrease
Right_Weld.C0 = CFrame.new(0, -1.5, 0)
end
end)
Mouse.Button2Down:connect(function()
if not Reloading and not Sprinting and not Aiming and (Camera.Focus.p - Camera.CoordinateFrame.p).magnitude < 1 then
Aiming = true
Mouse.Icon = Settings.Icons.Aim
Right_Weld.C1 = CFrame.new()
Right_Weld.C0 = CFrame.new()
Right_Weld.C1 = Character.Head.CFrame:toObjectSpace(Settings.AimPart.CFrame)
Left_Weld.C1 = Settings.LeftAimPos
if Settings.ChangeFOV[1] then
Camera.FieldOfView = Settings.ChangeFOV[2]
end
Tool.GripPos = Orig_Grip + Settings.AimGripOffset
Settings.Spread = Settings.Spread - Settings.SpreadReduction
end
end)
Mouse.Button2Up:connect(function()
if Aiming then
Mouse.Icon = Settings.Icons.Idle
Tool.GripPos = Orig_Grip
Right_Weld.C1 = Settings.RightPos
Right_Weld.C0 = CFrame.new(0, -1.5, 0)
Left_Weld.C1 = Settings.LeftPos
if Settings.ChangeFOV[1] then
Camera.FieldOfView = 70
end
Settings.Spread = Settings.Spread + Settings.SpreadReduction
Character.Torso.Neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
Character.Torso.Neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
wait(0.25)
Aiming = false
end
end)
wait()
Camera.Changed:connect(function()
if (Camera.Focus.p - Camera.CoordinateFrame.p).magnitude < 1 and Equipped then
Mouse.TargetFilter = workspace
Character.Torso.Neck.C1 = CFrame.new()
Character.Torso.Neck.C0 = CFrame.new(0, 1.5, 0) * CFrame.Angles(math.asin((Mouse.Hit.p - Mouse.Origin.p).unit.y), 0, 0)
end
end)
Mouse.Idle:connect(function()
if (Camera.Focus.p - Camera.CoordinateFrame.p).magnitude < 1 and Equipped then
Mouse.TargetFilter = workspace
Character.Torso.Neck.C1 = CFrame.new()
Character.Torso.Neck.C0 = CFrame.new(0, 1.5, 0) * CFrame.Angles(math.asin((Mouse.Hit.p - Mouse.Origin.p).unit.y), 0, 0)
end
end)
while wait() and Equipped do
if Sprinting then
Right_Weld.C0 = CFrame.new(0, -1.5, 0) * Settings.SprintArmOffset
Left_Weld.C0 = CFrame.new(0, -1.5, 0) * Settings.SprintArmOffset
elseif not Aiming then
Left_Weld.C0 = CFrame.new(0, -1.5, 0)
end
if (Camera.Focus.p - Camera.CoordinateFrame.p).magnitude > 1 and Equipped then
Mouse.TargetFilter = nil
Character.Torso.Neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
Character.Torso.Neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
end
end
end)

local Arms_Made
local Fake_Arm_Right, Fake_Arm_Left, Fake_Arm_Model

Tool.Equipped:connect(function(Mouse)
if Character and not Arms_Made then
Arms_Made = true
local Torso = Character.Torso
Torso["Right Shoulder"].Part1 = nil
Left_Weld = Instance.new("Weld", Torso)
Left_Weld.Name = "Left_Weld"
Left_Weld.Part0 = Character.Head
Left_Weld.C0 = CFrame.new(0, -1.5, 0)
if not Settings.OneHanded then
Torso["Left Shoulder"].Part1 = nil
Left_Weld.Part1 = Character["Left Arm"]
end
Right_Weld = Instance.new("Weld", Torso)
Right_Weld.Name = "Right_Weld"
Right_Weld.Part0 = Character.Head
Right_Weld.Part1 = Character["Right Arm"]
Right_Weld.C0 = CFrame.new(0, -1.5, 0)
Left_Weld.C1 = Settings.LeftPos
Right_Weld.C1 = Settings.RightPos
end
if Settings.FakeArms and not Fake_Arm_Right then
Fake_Arm_Right, Fake_Arm_Left = Character["Right Arm"]:Clone(), Character["Left Arm"]:Clone()
Fake_Arm_Right.FormFactor, Fake_Arm_Left.FormFactor = "Custom", "Custom"
Fake_Arm_Right.Size, Fake_Arm_Left.Size = Vector3.new(), Vector3.new()
local fakeArms = {Fake_Arm_Right, Fake_Arm_Left}
for i = 1, 2 do
local w = Instance.new("Weld", fakeArms[i])
w.Part0 = Character[fakeArms[i].Name]
w.Part1 = fakeArms[i]
fakeArms[i].Transparency = Settings.FakeArmTransparency
end
Fake_Arm_Model = Instance.new("Model", Camera)
Fake_Arm_Right.Parent = Fake_Arm_Model
if not Settings.OneHanded then
Fake_Arm_Left.Parent = Fake_Arm_Model
end
Fake_Arm_Model.Name = "FakeArms"
if Settings.CharacterMeshes then
for i, v in pairs(Character:GetChildren()) do
if v:IsA("CharacterMesh") and v.BodyPart == Enum.BodyPart.LeftArm or v:IsA("CharacterMesh") and v.BodyPart == Enum.BodyPart.RightArm then
v:Clone().Parent = Fake_Arm_Model
end
end
end
if Character:FindFirstChild("Shirt") then
Instance.new("Humanoid", Fake_Arm_Model)
Character.Shirt:Clone().Parent = Fake_Arm_Model
else
local Arm_Mesh = Instance.new("SpecialMesh", Fake_Arm_Right)
Arm_Mesh.MeshType, Arm_Mesh.Scale = "Brick", Vector3.new(5, 10, 5)
local Arm_Mesh2 = Instance.new("SpecialMesh", Fake_Arm_Left)
Arm_Mesh2.MeshType, Arm_Mesh2.Scale = "Brick", Vector3.new(5, 10, 5)
end
end
end)

Tool.Unequipped:connect(function()
Equipped = false
Tool.GripPos = Orig_Grip
Aiming = false
Settings.Spread = Orig_Spread
if Settings.ChangeFOV[1] then
Camera.FieldOfView = 70
end
if Gui then
Gui:Destroy()
Gui = nil
end
for i, v in pairs(Tool.Handle:GetChildren()) do
if v:IsA("Sound") then
v:Stop()
end
end
if Fake_Arm_Right and Fake_Arm_Left and Fake_Arm_Model then
Fake_Arm_Model:Destroy()
Fake_Arm_Right, Fake_Arm_Left, Fake_Arm_Model = nil, nil, nil
end
if Character and Left_Weld and Right_Weld then
Arms_Made = false
local Torso = Character.Torso
Torso["Right Shoulder"].Part1, Torso["Left Shoulder"].Part1 = Character["Right Arm"], Character["Left Arm"]
Left_Weld:Destroy()
Right_Weld:Destroy()
end
Sprinting = false
Character.Torso.Neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
Character.Torso.Neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
Character.Humanoid.WalkSpeed = 16
end)
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.