local z=nil local R=nil local m=nil local C=nil local q=nil local N local J=nil local T local M=nil local v=Tool.TextureId local O=game:GetService("\068\101\098\114\105\115")local b=game:GetService("\080\108\097\121\101\114\115")local V local n=nil local s=nil local U=false local Q=time()local o=script.Parent:WaitForChild("\070\108\097\114\101")local Z=nil local k=Workspace.Terrain.WorldToCellPreferSolid local j=Workspace.Terrain.GetCell function RayIgnoreCheck(z,m)if z then if z.Transparency>=1 or string.lower(z.Name)=="\119\097\116\101\114"or z.Name=="\069\102\102\101\099\116"or z.Name=="\082\111\099\107\101\116"or z.Name=="\066\117\108\108\101\116"or z.Name=="\072\097\110\100\108\101"or z:IsDescendantOf(R)then return true elseif z:IsA("\084\101\114\114\097\105\110")and m then local z=k(Workspace.Terrain,m)if z then local R=j(Workspace.Terrain,z.x,z.y,z.z)if R and R==Enum.CellMaterial.Water then return true end end end end return false end

local MyPlayer = nil
local MyCharacter = nil
local MyHumanoid = nil
local MyTorso = nil
local MyMouse = nil


local RecoilAnim
local RecoilTrack = nil

local ReloadAnim
local ReloadTrack = nil

local IconURL = Tool.TextureId  
local DebrisService = game:GetService('Debris')
local PlayersService = game:GetService('Players')


local FireSound

local OnFireConnection = nil
local OnReloadConnection = nil

local DecreasedAimLastShot = false
local LastSpreadUpdate = time()

local flare = script.Parent:WaitForChild("Flare")

local FlashHolder = nil


local WorldToCellFunction = Workspace.Terrain.WorldToCellPreferSolid
local GetCellFunction = Workspace.Terrain.GetCell

function RayIgnoreCheck(hit, pos)
	if hit then
		if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
				hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
				hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
			return true
		elseif hit:IsA('Terrain') and pos then
			local cellPos = WorldToCellFunction(Workspace.Terrain, pos)
			if cellPos then
				local cellMat = GetCellFunction(Workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
				if cellMat and cellMat == Enum.CellMaterial.Water then
					return true
				end
			end
		end
	end
	return false
end
