local g=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local w=g:WaitForChild("\077\111\100\117\108\101\115")local v=require(w.src.utils.Logger)local A=require(w.src.utils.StringUtils)local C=require(w.src.GhostAbility)local Q=game:GetService("\080\108\097\121\101\114\115")local t={}function t.isHuman(w,g)if C:getGhostCollisionGroupId()==g.CollisionGroupId then return end if g.Parent==nil then return false end local v=g.Parent:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if v then return true end return false end function t.getPlayerFromHuman(w,g)if t:isHuman(g)then local w=Q:GetPlayerFromCharacter(g.Parent)return w end return nil end function t.getPlayer(w,g)local v=Q:GetPlayerFromCharacter(g.Parent)return v end local function c(g,w)local v=workspace:FindPartsInRegion3WithIgnoreList(w,_G.ignorecommon)for w=1,#v,1 do if v[w]==g then return true end end return false end local function U(g)local w=workspace:FindPartsInRegion3WithIgnoreList(g,_G.ignorecommon)for g=1,#w,1 do if w[g].Name=="\084\111\114\115\111"then local v=w[g].Parent:FindFirstChild("\072\117\109\097\110\111\105\100")if v then return v end end end return nil end function CreateRegion3FromPart(g)return Region3.new(g.Position-g.Size/2,g.Position+g.Size/2)end function GetPlayersInPart(g)local w=CreateRegion3FromPart(g)local v=workspace:FindPartsInRegion3(w,nil,math.huge)local A={}for g,w in pairs(v)do local v=game.Players:GetPlayerFromCharacter(w.Parent)if v then table.insert(A,v)end end return A end return t
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local Modules = ReplicatedStorage:WaitForChild('Modules')
local logger = require(Modules.src.utils.Logger)
local StringUtils = require(Modules.src.utils.StringUtils)
local GhostAbility = require(Modules.src.GhostAbility)
local Players = game:GetService('Players')

local PlayerUtils = {}

function PlayerUtils:isHuman(hit)
	if GhostAbility:getGhostCollisionGroupId() == hit.CollisionGroupId then return end

	if hit.Parent == nil then
		return false
	end
	local humanoid = hit.Parent:FindFirstChild('HumanoidRootPart')
	if humanoid then
		return true
	end

	return false
end

function PlayerUtils:getPlayerFromHuman(hit)
	if PlayerUtils:isHuman(hit) then
		local player = Players:GetPlayerFromCharacter(hit.Parent)
		return player
	end

	return nil
end

function PlayerUtils:getPlayer(hit)
	local player = Players:GetPlayerFromCharacter(hit.Parent)
	return player
end

local function IsPartInRegion(part, region)
	local list = workspace:FindPartsInRegion3WithIgnoreList(region, _G.ignorecommon)
	for i = 1, #list do
		if list[i] == part then
			return true
		end
	end
	return false
end

local function IsHumanoidInRegion(region)
	local list = workspace:FindPartsInRegion3WithIgnoreList(region, _G.ignorecommon)
	for i = 1, #list do
		if list[i].Name == 'Torso' then
			local hum = list[i].Parent:FindFirstChild('Humanoid')
			if hum then
				return hum
			end
		end
	end
	return nil
end

function CreateRegion3FromPart(Part)
	return Region3.new(Part.Position - (Part.Size / 2), Part.Position + (Part.Size / 2))
end

function GetPlayersInPart(part)
	local region = CreateRegion3FromPart(part)
	local partsInRegion = workspace:FindPartsInRegion3(region, nil, math.huge)
	local players = {}
	for _, Part in pairs(partsInRegion) do
		local player = game.Players:GetPlayerFromCharacter(Part.Parent)
		if player then
			table.insert(players, player)
		end
	end
	return players
end

return PlayerUtils