return function(u)local c=u.Server local I=u.Service local F,S,Q,l,W,m,s,w,K,G local function A()F=c.Functions S=c.Admin Q=c.Anti l=c.Core W=c.HTTP m=c.Logs s=c.Remote w=c.Process K=c.Variables G=c.Settings m:AddLog("\083\099\114\105\112\116","\070\117\110\099\116\105\111\110\115 \077\111\100\117\108\101 \073\110\105\116\105\097\108\105\122\101\100")end c.Functions={Init=A,PlayerFinders={me={Match="\109\101";Prefix=true,Absolute=true,Function=function(u,c,I,F,S,Q,l)table.insert(F,c)Q()end},all={Match="\097\108\108";Prefix=true,Absolute=true,Function=function(u,c,I,F,S,Q,l)local W=true if l then for c,I in next,I:GetChildren()do local l=S(I)if(l.Name:lower()):sub(1,#u)==u:lower()then W=false table.insert(F,l)Q()end end end if W then for u,c in next,I:GetChildren()do local I=S(c)if I then table.insert(F,I)Q()end end end end};["\064\101\118\101\114\121\111\110\101"]={Match="\064\101\118\101\114\121\111\110\101",Absolute=true;Function=function(...)return F.PlayerMatchers.all.Function(...)end},others={Match="\111\116\104\101\114\115",Prefix=true;Absolute=true,Function=function(u,c,I,F,S,Q,l)for u,I in next,I:GetChildren()do local l=S(I)if l~=c then table.insert(F,l)Q()end end end},random={Match="\114\097\110\100\111\109";Prefix=true;Absolute=true;Function=function(u,c,I,S,Q,l,W)if#S>=#I:GetChildren()then return end local m=(I:GetChildren())[math.random(#I:children())]local s=Q(m)for m,w in pairs(S)do if w.Name==s.Name then F.PlayerFinders.random.Function(u,c,I,S,Q,l,W)return end end table.insert(S,s)l()end},admins={Match="\097\100\109\105\110\115";Prefix=true,Absolute=true,Function=function(u,c,I,F,Q,l,W)for u,c in next,I:children()do local I=Q(c)if S.CheckAdmin(I,false)then table.insert(F,I)l()end end end},nonadmins={Match="\110\111\110\097\100\109\105\110\115",Prefix=true,Absolute=true,Function=function(u,c,I,F,Q,l,W)for u,c in next,I:children()do local I=Q(c)if not S.CheckAdmin(I,false)then table.insert(F,I)l()end end end};friends={Match="\102\114\105\101\110\100\115",Prefix=true;Absolute=true,Function=function(u,c,I,F,S,Q,l)for u,I in next,I:children()do local l=S(I)if l:IsFriendsWith(c.userId)then table.insert(F,l)Q()end end end};["\037\116\101\097\109"]={Match="\037",Function=function(u,c,F,S,Q,l,W)local m=u:match("\037\037\040\046\042\041")if m then for u,c in next,I.Teams:GetChildren()do if(c.Name:lower()):sub(1,#m)==m:lower()then for u,I in next,F:GetChildren()do local F=Q(I)if F.TeamColor==c.TeamColor then table.insert(S,F)l()end end end end end end};["\036\103\114\111\117\112"]={Match="\036";Function=function(u,c,I,F,S,Q,l)local W=u:match("\037\036\040\046\042\041")if W and tonumber(W)then for u,c in next,I:children()do local I=S(c)if I:IsInGroup(tonumber(W))then table.insert(F,I)Q()end end end end};["\105\100-"]={Match="\105\100-";Function=function(u,c,F,S,Q,l,W)local m=tonumber(u:match("\105\100\037-\040\046\042\041"))local s=0 if m then for u,c in next,F:children()do local I=Q(c)if I and I.userId==m then table.insert(S,I)l()s=s+1 end end if s==0 then local u,c=pcall(function()return I.Players:GetNameFromUserIdAsync(m)end)if u and c then local u=I.Wrap(I.New("\070\111\108\100\101\114"))local F={Name=c,ToString=c,ClassName="\080\108\097\121\101\114",AccountAge=0,CharacterAppearanceId=tostring(m);UserId=tonumber(m),userId=tonumber(m);Parent=I.Players;Character=Instance.new("\077\111\100\101\108");Backpack=Instance.new("\070\111\108\100\101\114");PlayerGui=Instance.new("\070\111\108\100\101\114");PlayerScripts=Instance.new("\070\111\108\100\101\114"),Kick=function()u:Destroy()u:SetSpecial("\080\097\114\101\110\116",nil)end,IsA=function(u,c)if c=="\080\108\097\121\101\114"then return true end end}for c,I in next,F do u:SetSpecial(c,I)end table.insert(S,u)l()end end end end},["\100\105\115\112\108\097\121\110\097\109\101-"]={Match="\100\105\115\112\108\097\121\110\097\109\101-",Function=function(u,c,I,F,S,Q,l)local W=tonumber(u:match("\100\105\115\112\108\097\121\110\097\109\101\037-\040\046\042\041"))local m=0 if W then for u,c in next,I:children()do local I=S(c)if I and I.DisplayName==W then table.insert(F,I)Q()m=m+1 end end end end},["\116\101\097\109-"]={Match="\116\101\097\109-";Function=function(u,c,F,S,Q,l,W)print(1)local m=u:match("\116\101\097\109\037-\040\046\042\041")if m then for u,c in next,I.Teams:GetChildren()do if(c.Name:lower()):sub(1,#m)==m:lower()then for u,I in next,F:GetChildren()do local F=Q(I)if F.TeamColor==c.TeamColor then table.insert(S,F)l()end end end end end end},["\103\114\111\117\112-"]={Match="\103\114\111\117\112-",Function=function(u,c,I,F,S,Q,l)local W=u:match("\103\114\111\117\112\037-\040\046\042\041")if W and tonumber(W)then for u,c in next,I:children()do local I=S(c)if I:IsInGroup(tonumber(W))then table.insert(F,I)Q()end end end end};["-\110\097\109\101"]={Match="-",Function=function(u,c,F,S,Q,l,W)local m=u:match("\037-\040\046\042\041")if m then local u=I.GetPlayers(c,m,true)for c,I in next,S do for u,F in next,u do if I.Name==F.Name then table.remove(S,c)l()end end end end end},["\035\110\117\109\098\101\114"]={Match="\035";Function=function(u,c,...)local I=u:match("\037\035\040\046\042\041")if I and tonumber(I)then local S=tonumber(I)if not S then s.MakeGui(c,"\079\117\116\112\117\116",{Title="\079\117\116\112\117\116",Message="\073\110\118\097\108\105\100 \110\117\109\098\101\114\033"})end for I=1,S,1 do F.PlayerFinders.random.Function(u,c,...)end end end};["\114\097\100\105\117\115-"]={Match="\114\097\100\105\117\115-",Function=function(u,c,I,F,S,Q,l)local W=u:match("\114\097\100\105\117\115\037-\040\046\042\041")if W and tonumber(W)then local u=tonumber(W)if not u then s.MakeGui(c,"\079\117\116\112\117\116",{Title="\079\117\116\112\117\116";Message="\073\110\118\097\108\105\100 \110\117\109\098\101\114\033"})end for I,l in next,I:GetChildren()do local W=S(l)if W~=c and c:DistanceFromCharacter(W.Character.Head.Position)<=u then table.insert(F,W)Q()end end end end}};IsClass=function(u,c)for c,I in next,c do if u:IsA(I)then return true end end end;PerformOnEach=function(u,c,...)for u,I in next,u do pcall(c,I,...)end end,ArgsToString=function(u)local c=""for u,I in next,u do c=c..("\065\114\103"..(tostring(u)..("\058 "..(tostring(I).."\059 "))))end return c end;GetPlayers=function(u,c,Q,l,W,m)local w={}local K=G.SpecialPrefix if l then K=""end local A=I.NetworkServer or I.Players local function M(u)if u and u:IsA("\080\108\097\121\101\114")then return u elseif u and u:IsA("\078\101\116\119\111\114\107\082\101\112\108\105\099\097\116\111\114")then if u:GetPlayer()~=nil and(u:GetPlayer()):IsA("\080\108\097\121\101\114")then return u:GetPlayer()end end end local function P(c)for I,F in next,F.PlayerFinders do if not F.Level or F.Level and S.GetLevel(u)>=F.Level then local u=(F.Prefix and G.SpecialPrefix or"")..F.Match if F.Absolute and c:lower()==u or not F.Absolute and(c:lower()):sub(1,#u)==u:lower()then return F end end end end if u==nil then for u,c in pairs(A:GetChildren())do local I=M(c)if I then table.insert(w,I)end end elseif u and not c then return{u}else if(c:lower()):sub(1,2)=="\035\035"then error("\083\116\114\105\110\103 \112\097\115\115\101\100 \116\111 \071\101\116\080\108\097\121\101\114\115 \105\115 \102\105\108\116\101\114\101\100\058 "..tostring(c))else for c in c:gmatch("\040\091\094\044\093\043\041")do local F=0 local function S()F=F+1 end local m=P(c)if m then m.Function(c,u,A,w,M,S,W,l,Q)else for u,I in next,A:children()do local F=M(I)if F and(F.Name:lower()):sub(1,#c)==c:lower()then table.insert(w,F)S()end end if F==0 then local u,F=pcall(function()return I.Players:GetUserIdFromNameAsync(c)end)if u and tonumber(F)then local u=I.Wrap(I.New("\070\111\108\100\101\114"))local Q={Name=c,ToString=c;ClassName="\080\108\097\121\101\114",AccountAge=0;CharacterAppearanceId=tostring(F),UserId=tonumber(F);userId=tonumber(F),Parent=I.Players,Character=Instance.new("\077\111\100\101\108"),Backpack=Instance.new("\070\111\108\100\101\114"),PlayerGui=Instance.new("\070\111\108\100\101\114"),PlayerScripts=Instance.new("\070\111\108\100\101\114");Kick=function()u:Destroy()u:SetSpecial("\080\097\114\101\110\116",nil)end,IsA=function(u,c)if c=="\080\108\097\121\101\114"then return true end end}for c,I in next,Q do u:SetSpecial(c,I)end table.insert(w,u)S()end end end if F==0 and not Q then s.MakeGui(u,"\079\117\116\112\117\116",{Title="\079\117\116\112\117\116";Message="\078\111 \112\108\097\121\101\114\115 \109\097\116\099\104\105\110\103 "..(c.." \119\101\114\101 \102\111\117\110\100\033")})end end end end local k={}local g={}for u,c in next,w do if not g[c]then table.insert(k,c)g[c]=true end end return k end,GetRandom=function(u)local c=type(u)=="\110\117\109\098\101\114"and u or math.random(5,10)local I={}for u=1,c,1 do I[u]=string.format("\037\048\050\120",math.random(126))end return table.concat(I)end;Base64Encode=function(u)local c="\065\066\067\068\069\070\071\072\073\074\075\076\077\078\079\080\081\082\083\084\085\086\087\088\089\090\097\098\099\100\101\102\103\104\105\106\107\108\109\110\111\112\113\114\115\116\117\118\119\120\121\122\048\049\050\051\052\053\054\055\056\057\043\047"return(u:gsub("\046",function(u)local c,I="",u:byte()for u=8,1,-1 do c=c..(I%2^u-I%2^(u-1)>0 and"\049"or"\048")end return c end).."\048\048\048\048"):gsub("\037\100\037\100\037\100\063\037\100\063\037\100\063\037\100\063",function(u)if#u<6 then return""end local I=0 for c=1,6,1 do I=I+(u:sub(c,c)=="\049"and 2^(6-c)or 0)end return c:sub(I+1,I+1)end)..({"";"\061\061";"\061"})[#u%3+1]end,Base64Decode=function(u)local c="\065\066\067\068\069\070\071\072\073\074\075\076\077\078\079\080\081\082\083\084\085\086\087\088\089\090\097\098\099\100\101\102\103\104\105\106\107\108\109\110\111\112\113\114\115\116\117\118\119\120\121\122\048\049\050\051\052\053\054\055\056\057\043\047"u=string.gsub(u,"\091\094"..(c.."\061\093"),"")return(u:gsub("\046",function(u)if u=="\061"then return""end local I,F="",c:find(u)-1 for u=6,1,-1 do I=I..(F%2^u-F%2^(u-1)>0 and"\049"or"\048")end return I end)):gsub("\037\100\037\100\037\100\063\037\100\063\037\100\063\037\100\063\037\100\063\037\100\063",function(u)if#u~=8 then return""end local c=0 for I=1,8,1 do c=c+(u:sub(I,I)=="\049"and 2^(8-I)or 0)end return string.char(c)end)end;Hint=function(u,c,I)for c,F in pairs(c)do s.MakeGui(F,"\072\105\110\116",{Message=u;Time=I})end end;Message=function(u,c,I,F,S)for I,Q in pairs(I)do s.RemoveGui(Q,"\077\101\115\115\097\103\101")s.MakeGui(Q,"\077\101\115\115\097\103\101",{Title=u;Message=c;Scroll=F,Time=S})end end;Notify=function(u,c,I,F)for I,S in pairs(I)do s.RemoveGui(S,"\078\111\116\105\102\121")s.MakeGui(S,"\078\111\116\105\102\121",{Title=u;Message=c,Time=F})end end,MakeWeld=function(u,c)local F=I.New("\077\097\110\117\097\108\087\101\108\100",u)F.Part0=u F.Part1=c F.C0=u.CFrame:inverse()*c.CFrame return F end;SetView=function(u)if u=="\114\101\115\101\116"then workspace.CurrentCamera.CameraType="\067\117\115\116\111\109"workspace.CurrentCamera.CameraSubject=I.Player.Character.Humanoid workspace.CurrentCamera.FieldOfView=70 else workspace.CurrentCamera.CameraSubject=u end end;SetLighting=function(u,c)if I.Lighting[u]~=nil then I.Lighting[u]=c K.LightingSettings[u]=c for I,F in pairs(I.GetPlayers())do s.SetLighting(F,u,c)end end end;LoadEffects=function(u)for c,I in pairs(K.LocalEffects)do if I.Part and I.Part.Parent or I.NoPart then if I.Type=="\067\097\112\101"then s.Send(u,"\070\117\110\099\116\105\111\110","\078\101\119\067\097\112\101",I.Data)elseif I.Type=="\080\097\114\116\105\099\108\101"then s.NewParticle(u,I.Part,I.Class,I.Props)end else K.LocalEffects[c]=nil end end end,NewParticle=function(u,c,S)local Q=F.GetRandom()K.LocalEffects[Q]={Part=u,Class=c;Props=S;Type="\080\097\114\116\105\099\108\101"}for I,F in next,I.Players:GetPlayers()do s.NewParticle(F,u,c,S)end end;RemoveParticle=function(u,c)for I,F in next,K.LocalEffects do if F.Type=="\080\097\114\116\105\099\108\101"and(F.Part==u and(F.Props.Name==c or F.Class==c))then K.LocalEffects[I]=nil end end for I,F in next,I.Players:GetPlayers()do s.RemoveParticle(F,u,c)end end;UnCape=function(u)for c,I in pairs(K.LocalEffects)do if I.Type=="\067\097\112\101"and I.Player==u then K.LocalEffects[c]=nil end end for c,I in pairs(I.GetPlayers())do s.Send(I,"\070\117\110\099\116\105\111\110","\082\101\109\111\118\101\067\097\112\101",u.Character)end end,Cape=function(u,c,S,Q,l,W)F.UnCape(u)local m=u.Character:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if m then if type(Q)=="\116\097\098\108\101"then Q=Color3.new(Q[1],Q[2],Q[3])end local m={Color=Q,Parent=u.Character;Material=S;Reflectance=W;Decal=l}if c and(G.DonorCapes and G.LocalCapes)then s.Send(u,"\070\117\110\099\116\105\111\110","\078\101\119\067\097\112\101",m)else local c=F.GetRandom()K.LocalEffects[c]={Player=u,Part=u.Character.HumanoidRootPart;Data=m;Type="\067\097\112\101"}for u,c in pairs(I.GetPlayers())do s.Send(c,"\070\117\110\099\116\105\111\110","\078\101\119\067\097\112\101",m)end end end end,PlayAnimation=function(u,c)if u.Character and tonumber(c)then local F=u.Character:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")if F and not F:FindFirstChildOfClass("\065\110\105\109\097\116\111\114")then I.New("\065\110\105\109\097\116\111\114",F)end s.Send(u,"\070\117\110\099\116\105\111\110","\080\108\097\121\065\110\105\109\097\116\105\111\110",c)end end,ApplyBodyPart=function(u,c)local I=u:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")if I then local F=I.RigType==Enum.HumanoidRigType.R6 and"\082\054"or"\082\049\053"local S=c:FindFirstChild(F)if not S and F=="\082\049\053"then S=c:FindFirstChild("\082\049\053\070\105\120\101\100")end if S then if F=="\082\054"then local c=u:GetChildren()for I,F in pairs(S:GetChildren())do for u,c in pairs(c)do if c:IsA("\067\104\097\114\097\099\116\101\114\077\101\115\104")and c.BodyPart==F.BodyPart then c:Destroy()end end;(F:Clone()).Parent=u end elseif F=="\082\049\053"then local u={}for c,I in pairs(Enum.BodyPartR15:GetEnumItems())do u[I.Name]=I.Value end for c,F in pairs(S:GetChildren())do if u[F.Name]then I:ReplaceBodyPartR15(u[F.Name],F:Clone())end end end end end end,GetJoints=function(u)local c={}for u,I in pairs(u:GetDescendants())do if I:IsA("\077\111\116\111\114\054\068")then c[I.Name]=I end end return c end;LoadOnClient=function(u,c,S,Q)if I.Players:FindFirstChild(u.Name)then local I=u:FindFirstChildOfClass("\080\108\097\121\101\114\071\117\105")or u:WaitForChild("\080\108\097\121\101\114\071\117\105",15)or u:WaitForChild("\066\097\099\107\112\097\099\107")local W=l.NewScript("\076\111\099\097\108\083\099\114\105\112\116",c)W.Name=Q or F.GetRandom()W.Parent=I W.Disabled=false if S then table.insert(K.Objects,W)end end end,Split=function(u,c,I)if not u or not c or not I or I<=0 then return{}end if c==""then c=" "end local F={}local S=""for Q in u:gmatch("\040\091\094"..(c.."\093\043\041"))do if#F>=I then break elseif#F>=I-1 then table.insert(F,u:sub(#S+1,#u))else S=S..(Q..c)table.insert(F,Q)end end return F end;BasicSplit=function(u,c)local I={}for u in u:gmatch("\040\091\094"..(c.."\093\043\041"))do table.insert(I,u)end return I end,CountTable=function(u)local c=0 for u in pairs(u)do c=c+1 end return c end;GetTexture=function(u)u=F.Trim(tostring(u))local c if not tonumber(u)then return false else u=tonumber(u)end if not pcall(function()updated=(I.MarketPlace:GetProductInfo(u)).Created:match("\037\100\043-\037\100\043-\037\083\043\058\037\100\043")end)then return false end for c=0,10,1 do local F local S,Q=pcall(function()F=I.MarketPlace:GetProductInfo(u-c)end)if S then if F.AssetTypeId==1 and F.Created:match("\037\100\043-\037\100\043-\037\083\043\058\037\100\043")==updated then return u-c end end end end;Trim=function(u)return u:match("\094\037\115\042\040\046-\041\037\115\042\036")end;Round=function(u)return math.floor(u+.5)end;RoundToPlace=function(u,c)return math.floor(u*10^(c or 0)+.5)/10^(c or 0)end,GetOldDonorList=function()local u={}for c,F in pairs(I.InsertService:GetCollection(1290539))do local S=I.MarketPlace:GetProductInfo(F.AssetId)local Q=S.Description for c in Q:gmatch("\091\094\059\093\043")do local I,F,Q,l=c:match("\123\040\046\042\041\044\040\046\042\041\044\040\046\042\041\044\040\046\042\041\125")table.insert(u,{Name=I;Id=tostring(F),Cape=tostring(Q);Color=l;Material="\080\108\097\115\116\105\099";List=S.Name})end end K.OldDonorList=u end;CleanWorkspace=function()for u,c in pairs(I.Workspace:children())do if c:IsA("\084\111\111\108")or c:IsA("\065\099\099\101\115\115\111\114\121")or c:IsA("\072\097\116")then c:Destroy()end end end,RemoveSeatWelds=function(u)if u~=nil then for u,c in next,u:GetChildren()do if c:IsA("\087\101\108\100")then if c.Part1~=nil and c.Part1.Name=="\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116"then c:Destroy()end end end end end;GrabNilPlayers=function(u)local c={}for I,F in pairs(I.NetworkServer:GetChildren())do pcall(function()if F:IsA("\083\101\114\118\101\114\082\101\112\108\105\099\097\116\111\114")then if((F:GetPlayer()).Name:lower()):sub(1,#u)==u:lower()or u=="\097\108\108"then table.insert(c,F:GetPlayer()or"\078\111\080\108\097\121\101\114")end end end)end return c end;AssignName=function()local u=math.random(100000,999999)return u end;Shutdown=function(u)if not l.PanicMode then F.Message("\083\089\083\084\069\077 \077\069\083\083\065\071\069","\083\104\117\116\116\105\110\103 \100\111\119\110\046\046\046",I.Players:GetChildren(),false,5)wait(1)end I.Players.PlayerAdded:connect(function(c)c:Kick("\071\097\109\101 \115\104\117\116\100\111\119\110\058 "..tostring(u or"\078\111 \082\101\097\115\111\110 \071\105\118\101\110"))end)for c,F in pairs(I.NetworkServer:children())do I.Routine(function()if F and F:GetPlayer()then(F:GetPlayer()):Kick("\071\097\109\101 \115\104\117\116\100\111\119\110\058 "..tostring(u or"\078\111 \082\101\097\115\111\110 \071\105\118\101\110"))wait(30)if F.Parent and F:GetPlayer()then s.Send(F:GetPlayer(),"\070\117\110\099\116\105\111\110","\075\105\108\108\067\108\105\101\110\116")end end end)end end,Donor=function(u)if S.CheckDonor(u)and G.DonorCapes then local c=l.GetPlayer(u)or{Donor={}}local I=c.Donor or{}if I and I.Enabled then local c,S,Q if I and I.Cape then c,S,Q=I.Cape.Image,I.Cape.Color,I.Cape.Material else c,S,Q="\048","\087\104\105\116\101","\078\101\111\110"end if u and(u.Character and u.Character:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116"))then F.Cape(u,true,Q,S,c)end end end end;CheckMatch=function(u,c)if u==c then return true elseif type(u)=="\116\097\098\108\101"and type(c)=="\116\097\098\108\101"then local I=false local S=0 for u,F in pairs(u)do if F==c[u]then I=true else I=false break end S=S+1 end if I and S==F.CountTable(u)then return true end end end,DSKeyNormalize=function(u,c)local I={}if c then for u,c in next,u do if tonumber(u)then I[tonumber(u)]=c end end else for u,c in next,u do I[tostring(u)]=c end end return I end,GetIndex=function(u,c)for u,I in pairs(u)do if I==c then return u elseif type(I)=="\116\097\098\108\101"and type(c)=="\116\097\098\108\101"then local F=false for u,I in pairs(I)do if I==c[u]then F=true else F=false break end end if F then return u end end end end;ConvertPlayerCharacterToRig=function(u,I)I=I or"\082\049\053"local F=u.Character if not u.Character then u:LoadCharacter()u.CharacterAdded:Wait()F=u.Character end local S=F:FindFirstChild("\072\101\097\100")local Q=F:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")if S then local l=c.Deps.Assets["\082\105\103"..I]:Clone()local W=l:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")local m=S.CFrame l.Name=u.Name for u,c in pairs(F:children())do if c:IsA("\065\099\099\101\115\115\111\114\121")or c:IsA("\080\097\110\116\115")or c:IsA("\083\104\105\114\116")or c:IsA("\083\104\105\114\116\071\114\097\112\104\105\099")or c:IsA("\066\111\100\121\067\111\108\111\114\115")then c.Parent=l elseif c:IsA("\066\097\115\101\080\097\114\116")and(c.Name=="\072\101\097\100"and c:FindFirstChild("\102\097\099\101"))then l.Head.face.Texture=c.face.Texture end end u.Character=l l.Parent=workspace l.Head.CFrame=m Q.RigType=Enum.HumanoidRigType[I]end end;CreateClothingFromImageId=function(u,c)local I=Instance.new(u)I.Name=u I[u=="\083\104\105\114\116"and"\083\104\105\114\116\084\101\109\112\108\097\116\101"or u=="\080\097\110\116\115"and"\080\097\110\116\115\084\101\109\112\108\097\116\101"or u=="\083\104\105\114\116\071\114\097\112\104\105\099"and"\071\114\097\112\104\105\099"]=string.format("\114\098\120\097\115\115\101\116\105\100\058\047\047\037\100",c)return I end}end

return function(Vargs)
	local server = Vargs.Server;
	local service = Vargs.Service;

	local Functions, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Settings
	local function Init()
		Functions = server.Functions;
		Admin = server.Admin;
		Anti = server.Anti;
		Core = server.Core;
		HTTP = server.HTTP;
		Logs = server.Logs;
		Remote = server.Remote;
		Process = server.Process;
		Variables = server.Variables;
		Settings = server.Settings;

		Logs:AddLog("Script", "Functions Module Initialized")
	end;

	server.Functions = {
		Init = Init;
		PlayerFinders = {
			["me"] = {
				Match = "me";
				Prefix = true;
				Absolute = true;
				Function = function(msg, plr, parent, players, getplr, plus, isKicking)
					table.insert(players,plr)
					plus()
				end;
			};

			["all"] = {
				Match = "all";
				Prefix = true;
				Absolute = true;
				Function = function(msg, plr, parent, players, getplr, plus, isKicking)
					local everyone = true
					if isKicking then
						for i,v in next,parent:GetChildren() do
							local p = getplr(v)
							if p.Name:lower():sub(1,#msg)==msg:lower() then
								everyone = false
								table.insert(players,p)
								plus()
							end
						end
					end

					if everyone then
						for i,v in next,parent:GetChildren() do
							local p = getplr(v)
							if p then
								table.insert(players,p)
								plus()
							end
						end
					end
				end;
			};

			["@everyone"] = {
				Match = "@everyone";
				Absolute = true;
				Function = function(...)
					return Functions.PlayerMatchers.all.Function(...)
				end
			};

			["others"] = {
				Match = "others";
				Prefix = true;
				Absolute = true;
				Function = function(msg, plr, parent, players, getplr, plus, isKicking)
					for i,v in next,parent:GetChildren() do
						local p = getplr(v)
						if p ~= plr then
							table.insert(players,p)
							plus()
						end
					end
				end;
			};

			["random"] = {
				Match = "random";
				Prefix = true;
				Absolute = true;
				Function = function(msg, plr, parent, players, getplr, plus, isKicking)
					if #players>=#parent:GetChildren() then return end
					local rand = parent:GetChildren()[math.random(#parent:children())]
					local p = getplr(rand)

					for i,v in pairs(players) do
						if(v.Name == p.Name)then
							Functions.PlayerFinders.random.Function(msg, plr, parent, players, getplr, plus, isKicking)
							return;
						end
					end

					table.insert(players,p)
					plus();
				end;
			};

			["admins"] = {
				Match = "admins";
				Prefix = true;
				Absolute = true;
				Function = function(msg, plr, parent, players, getplr, plus, isKicking)
					for i,v in next,parent:children() do
						local p = getplr(v)
						if Admin.CheckAdmin(p,false) then
							table.insert(players, p)
							plus()
						end
					end
				end;
			};

			["nonadmins"] = {
				Match = "nonadmins";
				Prefix = true;
				Absolute = true;
				Function = function(msg, plr, parent, players, getplr, plus, isKicking)
					for i,v in next,parent:children() do
						local p = getplr(v)
						if not Admin.CheckAdmin(p,false) then
							table.insert(players,p)
							plus()
						end
					end
				end;
			};

			["friends"] = {
				Match = "friends";
				Prefix = true;
				Absolute = true;
				Function = function(msg, plr, parent, players, getplr, plus, isKicking)
					for i,v in next,parent:children() do
						local p = getplr(v)
						if p:IsFriendsWith(plr.userId) then
							table.insert(players,p)
							plus()
						end
					end
				end;
			};

			["%team"] = {
				Match = "%";
				Function = function(msg, plr, parent, players, getplr, plus, isKicking)
					local matched = msg:match("%%(.*)")
					if matched then
						for i,v in next,service.Teams:GetChildren() do
							if v.Name:lower():sub(1,#matched) == matched:lower() then
								for k,m in next,parent:GetChildren() do
									local p = getplr(m)
									if p.TeamColor == v.TeamColor then
										table.insert(players,p)
										plus()
									end
								end
							end
						end
					end
				end;
			};

			["$group"] = {
				Match = "$";
				Function = function(msg, plr, parent, players, getplr, plus, isKicking)
					local matched = msg:match("%$(.*)")
					if matched and tonumber(matched) then
						for i,v in next,parent:children() do
							local p = getplr(v)
							if p:IsInGroup(tonumber(matched)) then
								table.insert(players,p)
								plus()
							end
						end
					end
				end;
			};

			["id-"] = {
				Match = "id-";
				Function = function(msg, plr, parent, players, getplr, plus, isKicking)
					local matched = tonumber(msg:match("id%-(.*)"))
					local foundNum = 0
					if matched then
						for i,v in next,parent:children() do
							local p = getplr(v)
							if p and p.userId == matched then
								table.insert(players,p)
								plus()
								foundNum = foundNum+1
							end
						end

						if foundNum == 0 then
							local ran,name = pcall(function() return service.Players:GetNameFromUserIdAsync(matched) end)
							if ran and name then
								local fakePlayer = service.Wrap(service.New("Folder"))
								local data = {
									Name = name;
									ToString = name;
									ClassName = "Player";
									AccountAge = 0;
									CharacterAppearanceId = tostring(matched);
									UserId = tonumber(matched);
									userId = tonumber(matched);
									Parent = service.Players;
									Character = Instance.new("Model");
									Backpack = Instance.new("Folder");
									PlayerGui = Instance.new("Folder");
									PlayerScripts = Instance.new("Folder");
									Kick = function() fakePlayer:Destroy() fakePlayer:SetSpecial("Parent", nil) end;
									IsA = function(ignore, arg) if arg == "Player" then return true end end;
								}
								for i,v in next,data do fakePlayer:SetSpecial(i, v) end
								table.insert(players, fakePlayer)
								plus()
							end
						end
					end
				end;
			};
			
			["displayname-"] = {
				Match = "displayname-";
				Function = function(msg, plr, parent, players, getplr, plus, isKicking)
					local matched = tonumber(msg:match("displayname%-(.*)"))
					local foundNum = 0
					
					if matched then
						for i,v in next,parent:children() do
							local p = getplr(v)
							if p and p.DisplayName == matched then
								table.insert(players,p)
								plus()
								foundNum = foundNum+1
							end
						end
					end
				end;
			};

			["team-"] = {
				Match = "team-";
				Function = function(msg, plr, parent, players, getplr, plus, isKicking)
					print(1)
					local matched = msg:match("team%-(.*)")
					if matched then
						for i,v in next,service.Teams:GetChildren() do
							if v.Name:lower():sub(1,#matched) == matched:lower() then
								for k,m in next,parent:GetChildren() do
									local p = getplr(m)
									if p.TeamColor == v.TeamColor then
										table.insert(players, p)
										plus()
									end
								end
							end
						end
					end
				end;
			};

			["group-"] = {
				Match = "group-";
				Function = function(msg, plr, parent, players, getplr, plus, isKicking)
					local matched = msg:match("group%-(.*)")
					if matched and tonumber(matched) then
						for i,v in next,parent:children() do
							local p = getplr(v)
							if p:IsInGroup(tonumber(matched)) then
								table.insert(players,p)
								plus()
							end
						end
					end
				end;
			};

			["-name"] = {
				Match = "-";
				Function = function(msg, plr, parent, players, getplr, plus, isKicking)
					local matched = msg:match("%-(.*)")
					if matched then
						local removes = service.GetPlayers(plr,matched,true)
						for i,v in next,players do
							for k,p in next,removes do
								if v.Name == p.Name then
									table.remove(players,i)
									plus()
								end
							end
						end
					end
				end;
			};

			["#number"] = {
				Match = "#";
				Function = function(msg, plr, ...)
					local matched = msg:match("%#(.*)")
					if matched and tonumber(matched) then
						local num = tonumber(matched)
						if not num then
							Remote.MakeGui(plr,'Output',{Title = 'Output'; Message = "Invalid number!"})
						end

						for i = 1,num do
							Functions.PlayerFinders.random.Function(msg, plr, ...)
						end
					end
				end;
			};

			["radius-"] = {
				Match = "radius-";
				Function = function(msg, plr, parent, players, getplr, plus, isKicking)
					local matched = msg:match("radius%-(.*)")
					if matched and tonumber(matched) then
						local num = tonumber(matched)
						if not num then
							Remote.MakeGui(plr,'Output',{Title = 'Output'; Message = "Invalid number!"})
						end

						for i,v in next,parent:GetChildren() do
							local p = getplr(v)
							if p ~= plr and plr:DistanceFromCharacter(p.Character.Head.Position) <= num then
								table.insert(players,p)
								plus()
							end
						end
					end
				end;
			};			
		};

		IsClass = function(obj, classList)
			for _,class in next,classList do
				if obj:IsA(class) then
					return true
				end
			end
		end;

		PerformOnEach = function(itemList, func, ...)
			for i,v in next,itemList do
				pcall(func, v, ...)
			end
		end;

		ArgsToString = function(args)
			local str = ""
			for i,arg in next,args do
				str = str.."Arg"..tostring(i)..": "..tostring(arg).."; "
			end
			return str
		end;

		GetPlayers = function(plr, names, dontError, isServer, isKicking, noID)
			local players = {} 
			local prefix = Settings.SpecialPrefix
			if isServer then prefix = "" end
			local parent = service.NetworkServer or service.Players

			local function getplr(p)
				if p and p:IsA("Player") then
					return p
				elseif p and p:IsA('NetworkReplicator') then
					if p:GetPlayer()~=nil and p:GetPlayer():IsA('Player') then
						return p:GetPlayer()
					end
				end
			end

			local function checkMatch(msg)
				for ind, data in next, Functions.PlayerFinders do
					if not data.Level or (data.Level and Admin.GetLevel(plr) >= data.Level) then
						local check = ((data.Prefix and Settings.SpecialPrefix) or "")..data.Match
						if (data.Absolute and msg:lower() == check) or (not data.Absolute and msg:lower():sub(1,#check) == check:lower()) then
							return data
						end
					end
				end
			end

			if plr == nil then
				for i,v in pairs(parent:GetChildren()) do
					local p = getplr(v)
					if p then
						table.insert(players,p)
					end
				end
			elseif plr and not names then
				return {plr}
			else
				if names:lower():sub(1,2) == "##" then
					error("String passed to GetPlayers is filtered: "..tostring(names))
				else
					for s in names:gmatch('([^,]+)') do
						local plrs = 0
						local function plus()
							plrs = plrs+1
						end

						local matchFunc = checkMatch(s)
						if matchFunc then
							matchFunc.Function(s, plr, parent, players, getplr, plus, isKicking, isServer, dontError)
						else
							for i,v in next,parent:children() do
								local p = getplr(v)
								if p and p.Name:lower():sub(1,#s)==s:lower() then
									table.insert(players,p)
									plus()
								end
							end

							if plrs == 0 then
								local ran,userid = pcall(function() return service.Players:GetUserIdFromNameAsync(s) end)
								if ran and tonumber(userid) then
									local fakePlayer = service.Wrap(service.New("Folder"))
									local data = {
										Name = s;
										ToString = s;
										ClassName = "Player";
										AccountAge = 0;
										CharacterAppearanceId = tostring(userid);
										UserId = tonumber(userid);
										userId = tonumber(userid);
										Parent = service.Players;
										Character = Instance.new("Model");
										Backpack = Instance.new("Folder");
										PlayerGui = Instance.new("Folder");
										PlayerScripts = Instance.new("Folder");
										Kick = function() fakePlayer:Destroy() fakePlayer:SetSpecial("Parent", nil) end;
										IsA = function(ignore, arg) if arg == "Player" then return true end end;
									}
									for i,v in next,data do fakePlayer:SetSpecial(i, v) end
									table.insert(players, fakePlayer)
									plus()
								end
							end
						end

						if plrs == 0 and not dontError then 
							Remote.MakeGui(plr,'Output',{Title = 'Output'; Message = 'No players matching '..s..' were found!'}) 
						end
					end
				end
			end

			--// The following is intended to prevent name spamming (eg. :re scel,scel,scel,scel,scel,scel,scel,scel,scel,scel,scel,scel,scel,scel...)
			--// It will also prevent situations where a player falls within multiple player finders (eg. :re group-1928483,nonadmins,radius-50 (one player can match all 3 of these))
			local filteredList = {};
			local checkList = {};

			for i,v in next, players do
				if not checkList[v] then
					table.insert(filteredList, v);
					checkList[v] = true;
				end
			end

			return filteredList;
		end;

		GetRandom = function(pLen)
			--local str = ""
			--for i=1,math.random(5,10) do str=str..string.char(math.random(33,90)) end
			--return str
			local Len = (type(pLen) == "number" and pLen) or math.random(5,10) --// reru
			local Res = {};
			for Idx = 1, Len do
				Res[Idx] = string.format('%02x', math.random(126));
			end;
			return table.concat(Res)
		end; 

		Base64Encode = function(data)
			local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
			return ((data:gsub('.', function(x) 
				local r,b='',x:byte()
				for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end
				return r;
			end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
				if (#x < 6) then return '' end
				local c=0
				for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end
				return b:sub(c+1,c+1)
			end)..({ '', '==', '=' })[#data%3+1])
		end;

		Base64Decode = function(data)
			local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
			data = string.gsub(data, '[^'..b..'=]', '')
			return (data:gsub('.', function(x)
				if (x == '=') then return '' end
				local r,f='',(b:find(x)-1)
				for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end
				return r;
			end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
				if (#x ~= 8) then return '' end
				local c=0
				for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end
				return string.char(c)
			end))
		end;

		Hint = function(message,players,time)
			for i,v in pairs(players) do
				Remote.MakeGui(v,"Hint",{
					Message = message;
					Time = time;
				})
			end
		end;

		Message = function(title,message,players,scroll,tim)
			for i,v in pairs(players) do
				Remote.RemoveGui(v,"Message")
				Remote.MakeGui(v,"Message",{
					Title = title;
					Message = message;
					Scroll = scroll;
					Time = tim;
				})
			end
		end;

		Notify = function(title,message,players,tim)
			for i,v in pairs(players) do
				Remote.RemoveGui(v,"Notify")
				Remote.MakeGui(v,"Notify",{
					Title = title;
					Message = message;
					Time = tim;
				})
			end
		end;

		MakeWeld = function(a, b)
			local weld = service.New("ManualWeld", a)
			weld.Part0 = a
			weld.Part1 = b
			weld.C0 = a.CFrame:inverse() * b.CFrame
			return weld
		end;

		SetView = function(ob)
			if ob == 'reset' then
				workspace.CurrentCamera.CameraType = 'Custom' 
				workspace.CurrentCamera.CameraSubject = service.Player.Character.Humanoid
				workspace.CurrentCamera.FieldOfView = 70
			else
				workspace.CurrentCamera.CameraSubject = ob
			end
		end;

		SetLighting = function(prop,value)
			if service.Lighting[prop]~=nil then
				service.Lighting[prop] = value
				Variables.LightingSettings[prop] = value
				for ind,p in pairs(service.GetPlayers()) do
					Remote.SetLighting(p,prop,value)
				end
			end
		end;

		LoadEffects = function(plr)
			for i,v in pairs(Variables.LocalEffects) do
				if (v.Part and v.Part.Parent) or v.NoPart then
					if v.Type == "Cape" then
						Remote.Send(plr,"Function","NewCape",v.Data)
					elseif v.Type == "Particle" then
						Remote.NewParticle(plr,v.Part,v.Class,v.Props)
					end
				else
					Variables.LocalEffects[i] = nil
				end
			end
		end;

		NewParticle = function(target,type,props)
			local ind = Functions.GetRandom()
			Variables.LocalEffects[ind] = {
				Part = target;
				Class = type;
				Props = props;
				Type = "Particle";
			}
			for i,v in next,service.Players:GetPlayers() do
				Remote.NewParticle(v,target,type,props)
			end
		end;

		RemoveParticle = function(target,name)
			for i,v in next,Variables.LocalEffects do
				if v.Type == "Particle" and v.Part == target and (v.Props.Name == name or v.Class == name) then
					Variables.LocalEffects[i] = nil
				end
			end
			for i,v in next,service.Players:GetPlayers() do
				Remote.RemoveParticle(v,target,name)
			end
		end;

		UnCape = function(plr)
			for i,v in pairs(Variables.LocalEffects) do
				if v.Type == "Cape" and v.Player == plr then
					Variables.LocalEffects[i] = nil
				end
			end
			for i,v in pairs(service.GetPlayers()) do
				Remote.Send(v,"Function","RemoveCape",plr.Character)
			end
		end;

		Cape = function(player,isdon,material,color,decal,reflect)
			Functions.UnCape(player)
			local torso = player.Character:FindFirstChild("HumanoidRootPart")
			if torso then
				if type(color) == "table" then 
					color = Color3.new(color[1],color[2],color[3]) 
				end

				local data = {
					Color = color;
					Parent = player.Character;
					Material = material;
					Reflectance = reflect;
					Decal = decal;
				}

				if (isdon and Settings.DonorCapes and Settings.LocalCapes) then
					Remote.Send(player,"Function","NewCape",data)
				else
					local ind = Functions.GetRandom()
					Variables.LocalEffects[ind] = {
						Player = player;
						Part = player.Character.HumanoidRootPart;
						Data = data;
						Type = "Cape";
					}
					for i,v in pairs(service.GetPlayers()) do
						Remote.Send(v,"Function","NewCape",data)
					end
				end
			end
		end;

		PlayAnimation = function(player, animId)
			if player.Character and tonumber(animId) then
				local human = player.Character:FindFirstChildOfClass("Humanoid")
				if human and not human:FindFirstChildOfClass("Animator") then
					service.New("Animator", human)
				end
				Remote.Send(player,"Function","PlayAnimation",animId)
			end
		end;

		ApplyBodyPart = function(character, model)
			local humanoid = character:FindFirstChildOfClass("Humanoid")
			if humanoid then 
				local rigType = humanoid.RigType == Enum.HumanoidRigType.R6 and "R6" or "R15"
				local part = model:FindFirstChild(rigType)

				if not part and rigType == "R15" then 
					part = model:FindFirstChild("R15Fixed") -- some bundles dont have the normal R15 folder...
				end

				if part then 
					if rigType == "R6" then 
						local children = character:GetChildren()
						for _,v in pairs(part:GetChildren()) do 
							for _,x in pairs(children) do
								if x:IsA("CharacterMesh") and x.BodyPart == v.BodyPart then 
									x:Destroy()
								end 
							end
							v:Clone().Parent = character
						end 
					elseif rigType == "R15" then 
						local validParts = {}
						for _,x in pairs(Enum.BodyPartR15:GetEnumItems()) do 
							validParts[x.Name] = x.Value 
						end
						for _,v in pairs(part:GetChildren()) do 
							if validParts[v.Name] then 
								humanoid:ReplaceBodyPartR15(validParts[v.Name], v:Clone())
							end 
						end
					end
				end
			end
		end;

		GetJoints = function(character)
			local temp = {}
			for _,v in pairs(character:GetDescendants()) do
				if v:IsA("Motor6D") then 
					temp[v.Name] = v -- assumes no 2 joints have the same name, hopefully this wont cause issues
				end
			end
			return temp
		end;

		LoadOnClient = function(player,source,object,name)
			if service.Players:FindFirstChild(player.Name) then
				local parent = player:FindFirstChildOfClass("PlayerGui") or player:WaitForChild('PlayerGui', 15) or player:WaitForChild('Backpack')
				local cl = Core.NewScript('LocalScript',source)
				cl.Name = name or Functions.GetRandom()
				cl.Parent = parent
				cl.Disabled = false
				if object then
					table.insert(Variables.Objects,cl)
				end
			end
		end;

		Split = function(msg,key,num)
			if not msg or not key or not num or num <= 0 then return {} end
			if key=="" then key = " " end

			local tab = {}
			local str = ''

			for arg in msg:gmatch('([^'..key..']+)') do
				if #tab>=num then 
					break
				elseif #tab>=num-1 then
					table.insert(tab,msg:sub(#str+1,#msg))
				else
					str = str..arg..key
					table.insert(tab,arg)
				end
			end

			return tab
		end;

		BasicSplit = function(msg,key)
			local ret = {}
			for arg in msg:gmatch("([^"..key.."]+)") do
				table.insert(ret,arg)
			end
			return ret
		end;

		CountTable = function(tab)
			local num = 0
			for i in pairs(tab) do
				num = num+1
			end
			return num
		end;

		GetTexture = function(ID)
			ID = Functions.Trim(tostring(ID))
			local created

			if not tonumber(ID) then 
				return false 
			else 
				ID = tonumber(ID) 
			end

			if not pcall(function() updated=service.MarketPlace:GetProductInfo(ID).Created:match("%d+-%d+-%S+:%d+") end) then 
				return false
			end

			for i = 0,10 do
				local info
				local ran,error = pcall(function() info = service.MarketPlace:GetProductInfo(ID-i) end)
				if ran then
					if info.AssetTypeId == 1 and info.Created:match("%d+-%d+-%S+:%d+") == updated then
						return ID-i
					end
				end
			end
		end;

		Trim = function(str)
			return str:match("^%s*(.-)%s*$")
		end;

		Round = function(num)
			return math.floor(num + 0.5)
		end;

		RoundToPlace = function(num, places)
			return math.floor((num*(10^(places or 0)))+0.5)/(10^(places or 0))
		end;

		GetOldDonorList = function()
			local temp={}
			for k,asset in pairs(service.InsertService:GetCollection(1290539)) do
				local ins=service.MarketPlace:GetProductInfo(asset.AssetId)
				local fo=ins.Description
				for so in fo:gmatch('[^;]+') do
					local name,id,cape,color=so:match('{(.*),(.*),(.*),(.*)}')
					table.insert(temp,{Name=name,Id=tostring(id),Cape=tostring(cape),Color=color,Material='Plastic',List=ins.Name})
				end
			end
			Variables.OldDonorList = temp
		end;

		CleanWorkspace = function()
			for i,v in pairs(service.Workspace:children()) do 
				if v:IsA("Tool") or v:IsA("Accessory") or v:IsA("Hat") then 
					v:Destroy() 
				end
			end
		end;

		RemoveSeatWelds = function(seat)
			if seat~=nil then
				for i,v in next,seat:GetChildren() do
					if v:IsA("Weld") then
						if v.Part1 ~= nil and v.Part1.Name=="HumanoidRootPart" then
							v:Destroy()
						end 
					end 
				end 
			end 
		end;

		GrabNilPlayers = function(name)
			local AllGrabbedPlayers = {}
			for i,v in pairs(service.NetworkServer:GetChildren()) do
				pcall(function()
					if v:IsA("ServerReplicator") then
						if v:GetPlayer().Name:lower():sub(1,#name)==name:lower() or name=='all' then
							table.insert(AllGrabbedPlayers, (v:GetPlayer() or "NoPlayer"))
						end
					end
				end)
			end
			return AllGrabbedPlayers
		end;

		AssignName = function()
			local name=math.random(100000,999999)
			return name
		end;

		Shutdown = function(reason)
			if not Core.PanicMode then
				Functions.Message("SYSTEM MESSAGE", "Shutting down...", service.Players:GetChildren(), false, 5) 
				wait(1)
			end

			service.Players.PlayerAdded:connect(function(p)
				p:Kick("Game shutdown: ".. tostring(reason or "No Reason Given"))
			end)

			for i,v in pairs(service.NetworkServer:children()) do
				service.Routine(function()
					if v and v:GetPlayer() then
						v:GetPlayer():Kick("Game shutdown: ".. tostring(reason or "No Reason Given"))
						wait(30)
						if v.Parent and v:GetPlayer() then
							Remote.Send(v:GetPlayer(),'Function','KillClient')
						end
					end
				end)
			end
		end;

		Donor = function(plr)
			if (Admin.CheckDonor(plr) and Settings.DonorCapes) then
				local PlayerData = Core.GetPlayer(plr) or {Donor = {}}
				local donor = PlayerData.Donor or {}
				if donor and donor.Enabled then
					local img,color,material
					if donor and donor.Cape then 
						img,color,material = donor.Cape.Image,donor.Cape.Color,donor.Cape.Material
					else
						img,color,material = '0','White','Neon'
					end 
					if plr and plr.Character and plr.Character:FindFirstChild("HumanoidRootPart") then
						Functions.Cape(plr,true,material,color,img)
					end
					--[[
					if Admin.CheckDonor(plr) and (Settings.DonorPerks or Admin.GetLevel(plr)>=4) then
						local gear=service.InsertService:LoadAsset(57902997):children()[1]
						if not plr.Backpack:FindFirstChild(gear.Name..'DonorTool') then
							gear.Name=gear.Name..'DonorTool'
							gear.Parent=plr.Backpack
						else
							gear:Destroy()
						end
					end --]]
				end
			end
		end;

		CheckMatch = function(check,match)
			if check==match then
				return true
			elseif type(check)=="table" and type(match)=="table" then
				local good = false
				local num = 0
				for k,m in pairs(check) do
					if m == match[k] then
						good = true
					else
						good = false
						break
					end
					num = num+1
				end
				if good and num==Functions.CountTable(check) then 
					return true
				end
			end
		end;

		DSKeyNormalize = function(intab, reverse)
			local tab = {}

			if reverse then
				for i,v in next,intab do
					if tonumber(i) then
						tab[tonumber(i)] = v;
					end
				end
			else
				for i,v in next,intab do
					tab[tostring(i)] = v;
				end
			end

			return tab;
		end;

		GetIndex = function(tab,match)
			for i,v in pairs(tab) do 
				if v==match then
					return i
				elseif type(v)=="table" and type(match)=="table" then
					local good = false
					for k,m in pairs(v) do
						if m == match[k] then
							good = true
						else
							good = false
							break
						end
					end
					if good then 
						return i
					end
				end
			end
		end;

		--// Couldn't merge due to "conflicts" so just added manually.
		ConvertPlayerCharacterToRig = function(p, rigType)
			rigType = rigType or "R15"

			local char = p.Character
			if not p.Character then
				p:LoadCharacter()
				p.CharacterAdded:Wait()
				char = p.Character
			end

			local head = char:FindFirstChild"Head"
			local human = char:FindFirstChildOfClass"Humanoid"

			if head then
				local rig = server.Deps.Assets["Rig"..rigType]:Clone() -- requires R6 and R15 in Dependencies to retrieve the Rig Models !!
				local rigHuman = rig:FindFirstChildOfClass"Humanoid"
				local origHeadCF = head.CFrame
				rig.Name = p.Name

				for a,b in pairs(char:children()) do
					if b:IsA("Accessory") or b:IsA("Pants") or b:IsA("Shirt") or b:IsA("ShirtGraphic") or b:IsA("BodyColors") then
						b.Parent = rig
					elseif b:IsA"BasePart" and b.Name == "Head" and b:FindFirstChild("face") then
						rig.Head.face.Texture = b.face.Texture
					end
				end

				p.Character = rig
				rig.Parent = workspace
				rig.Head.CFrame = origHeadCF

				human.RigType = Enum.HumanoidRigType[rigType]
			end
		end;

		CreateClothingFromImageId = function(clothingtype, Id)
			local Clothing = Instance.new(clothingtype)
			Clothing.Name = clothingtype
			Clothing[clothingtype == "Shirt" and "ShirtTemplate" or clothingtype == "Pants" and "PantsTemplate" or clothingtype == "ShirtGraphic" and "Graphic"] = string.format("rbxassetid://%d", Id)
			return Clothing
		end
	};
end
