Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Vnew = Vector3.new
- local Cnew = CFrame.new
- local CAngles = CFrame.Angles
- local Inaccuracy = 0
- local mmin = math.min
- local mrandom = math.random
- local mmax = math.max
- local Bnew = BrickColor.new
- local tinsert = table.insert
- local mrandom = mrandom
- local mmax = mmax
- local mrad = math.rad
- local mfloor = math.floor
- local Bnew = Bnew
- function randomspread(fadg)
- if mrandom(1, 2) == 1 then
- return mrandom(-fadg, -fadg / 3)
- else
- return mrandom(fadg / 3, fadg)
- end
- end
- local function shoot()
- local Camera = game.Workspace.CurrentCamera
- local Char = game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name)
- if Char ~= nil then
- local Tool = game.Players.LocalPlayer.Character:FindFirstChildOfClass("Tool")
- if Tool ~= nil then
- local ToolName = Tool.Name
- local gunenv = getsenv(game.Players.LocalPlayer.Character[ToolName].Gun)
- local gupvs = debug.getupvalues(gunenv.Fire)
- local Settings = gupvs.Settings
- local gupvsz = debug.getupvalues(gunenv.firethebox)
- gupvsz.Firing = true
- local MyPlayer = game.Players.LocalPlayer
- local endpos = Camera.CFrame.p + Camera.CFrame.lookVector * 999
- local startpos = game.Players.LocalPlayer.Character.Head.Position
- local Spread = CAngles(mrad(randomspread(0) / 20), mrad(randomspread(0) / 20), mrad(randomspread(0) / 20))
- local RayCasted = Ray.new(startpos, (Cnew(startpos, endpos) * Spread).lookVector.unit * Settings.Range)
- local Ray_Ignore = gupvsz.Ray_Ignore
- local Hit, Pos, normal = workspace:FindPartOnRayWithIgnoreList(RayCasted, Ray_Ignore, false, true)
- local flek = Camera.Arms.Flash.Position
- local FakeRayCasted = Ray.new(Camera.Arms.Flash.Position, (CFrame.new(Camera.Arms.Flash.Position, endpos) * Spread).lookVector.unit * 5)
- local Hit12, Pos12 = game.Workspace:FindPartOnRayWithIgnoreList(FakeRayCasted, Ray_Ignore, false, true)
- Tool.Gun.sv_gun.Fire:FireServer(normal, Hit, Pos, Spread, MyPlayer, startpos, endpos, 10000, 10000, 0.01, Settings.MSX, 10000, 10000, 10000, 0.01, 10000, 10000, false, Tool.Handle, ToolName, false, false, Pos12, flek)
- end
- end
- end
- local eDown = false
- local input = game:GetService("UserInputService")
- local player = game.Players.LocalPlayer
- input.InputBegan:connect(function(k)
- local key = k.KeyCode
- if key == Enum.KeyCode.E then
- eDown = true
- end
- end)
- input.InputEnded:connect(function(k)
- local key = k.KeyCode
- if key == Enum.KeyCode.E then
- eDown = false
- end
- end)
- print("Loaded!")
- while wait() do
- if eDown then
- local shot, failed = pcall(shoot)
- if not shot then
- print("Error: "..failed)
- end
- end
- end
Add Comment
Please, Sign In to add comment