Players=game:GetService("\080\108\097\121\101\114\115")Debris=game:GetService("\068\101\098\114\105\115")ProjectileNames={"\087\097\116\101\114","\065\114\114\111\119";"\080\114\111\106\101\099\116\105\108\101","\069\102\102\101\099\116","\082\097\105\108";"\076\097\115\101\114","\082\097\121","\066\117\108\108\101\116";"\080\097\114\116\105\099\108\101\080\097\114\116"}Functions={CheckTableForString=function(y,P)for y,X in pairs(y)do if string.lower(X)==string.lower(P)then return true end end return false end;CheckIntangible=function(y)if y and y.Parent then if y.Transparency>=1 and not y.CanCollide or Functions.CheckTableForString(ProjectileNames,y.Name)then return true end local P=y.Parent local X=P.Parent local C=X:FindFirstChild("\072\117\109\097\110\111\105\100")if C and(C.Health>0 and P:IsA("\065\099\099\111\117\116\114\101\109\101\110\116"))then return true end end return false end,CastRay=function(y,P,X,C,D)local U,m,A=(game:GetService("\087\111\114\107\115\112\097\099\101")):FindPartOnRayWithIgnoreList(Ray.new(y,P*X),C)if U and Functions.CheckIntangible(U)then if D then wait()end U,m,A=Functions.CastRay(m+P*.01,P,X-(y-m).magnitude,C,D)end return U,m,A end,IsTeamMate=function(y,P)return y and(P and(not y.Neutral and(not P.Neutral and y.TeamColor==P.TeamColor)))end;TagHumanoid=function(y,P)local X=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")X.Name="\099\114\101\097\116\111\114"X.Value=P Debris:AddItem(X,2)X.Parent=y end;UntagHumanoid=function(y)for y,P in pairs(y:GetChildren())do if P:IsA("\079\098\106\101\099\116\086\097\108\117\101")and P.Name=="\099\114\101\097\116\111\114"then P:Destroy()end end end}return Functions


Players = game:GetService("Players")
Debris = game:GetService("Debris")

ProjectileNames = {"Water", "Arrow", "Projectile", "Effect", "Rail", "Laser", "Ray", "Bullet", "ParticlePart"}

Functions = {
	
	CheckTableForString = (function(Table, String)
		for i, v in pairs(Table) do
			if string.lower(v) == string.lower(String) then
				return true
			end
		end
		return false
	end),

	CheckIntangible = (function(Hit)
		if Hit and Hit.Parent then
			if (Hit.Transparency >= 1 and not Hit.CanCollide) or Functions.CheckTableForString(ProjectileNames, Hit.Name) then
				return true
			end
			local ObjectParent = Hit.Parent
			local Character = ObjectParent.Parent
			local Humanoid = Character:FindFirstChild("Humanoid")
			if Humanoid and Humanoid.Health > 0 and ObjectParent:IsA("Accoutrement") then
				return true
			end
		end
		return false
	end),
	
	CastRay = (function(StartPos, Vec, Length, Ignore, DelayIfHit)
		local RayHit, RayPos, RayNormal = game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(StartPos, Vec * Length), Ignore)
		if RayHit and Functions.CheckIntangible(RayHit) then
			if DelayIfHit then
				wait()
			end
			RayHit, RayPos, RayNormal = Functions.CastRay((RayPos + (Vec * 0.01)), Vec, (Length - ((StartPos - RayPos).magnitude)), Ignore, DelayIfHit)
		end
		return RayHit, RayPos, RayNormal
	end),

	IsTeamMate = (function(Player1, Player2)
		return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
	end),

	TagHumanoid = (function(humanoid, player)
		local Creator_Tag = Instance.new("ObjectValue")
		Creator_Tag.Name = "creator"
		Creator_Tag.Value = player
		Debris:AddItem(Creator_Tag, 2)
		Creator_Tag.Parent = humanoid
	end),

	UntagHumanoid = (function(humanoid)
		for i, v in pairs(humanoid:GetChildren()) do
			if v:IsA("ObjectValue") and v.Name == "creator" then
				v:Destroy()
			end
		end
	end),
}

return Functions
