local u=game:GetService("\082\117\110\083\101\114\118\105\099\101")local c=bit32.band local N=bit32.bor local z=bit32.lshift local r={}local l=0 for u=0,31,1 do table.insert(r,z(1,u))end local s=.2 local L=1-s local v={}local x=0 local function e() end local w=1e-05 local function P(u,c)if u==c then return true end return math.abs(u-c)<w end local function A(u,c)if u==c then return true end if not u.Position:FuzzyEq(c.Position)then return false end if not u.LookVector:FuzzyEq(c.LookVector)then return false end if not u.RightVector:FuzzyEq(c.RightVector)then return false end if not u.UpVector:FuzzyEq(c.UpVector)then return false end return true end local function C(u,c)local z=l local s={true;z}for c,l in ipairs(c)do local L=u[l]if L~=nil then z=N(z,r[c])table.insert(s,L)end end s[2]=z return s end local function V(u,N,z)if not u then return{}end local s={}local L=table.getn(u)local v=u[2]local x=1 for L=3,L,1 do for z=x,z,1 do x=x+1 if c(v,r[z])~=l then s[N[z]]=u[L]break end end end return s end local function Q(u,c,z)local s=l local L=l local v={L,s}for z,l in ipairs(z)do local x=u[l]local e=c[l]if x==nil then if e~=nil then s=N(s,r[z])table.insert(v,e)end elseif e==nil then L=N(L,r[z])else local u=typeof(x)local c=typeof(e)local l=false if u==c then if u=="\110\117\109\098\101\114"and not P(x,e)then l=true elseif u=="\086\101\099\116\111\114\051"and not x:FuzzyEq(e)then l=true elseif u=="\067\070\114\097\109\101"and not A(x,e)then l=true elseif x~=e then l=true end elseif x~=e then l=true end if l then s=N(s,r[z])table.insert(v,e)end end end v[1]=L v[2]=s return v end local function n(u,N,s,L,v)if not N then N={l,l}end if not u then u={}end local x={}local e=N[1]local w=N[2]local P={}local A=table.getn(N)local C=1 if w~=l then for u=3,A,1 do for z=C,v,1 do C=C+1 local L=r[z]if c(e,L)~=l then P[z]=true elseif c(w,L)~=l then P[z]=true x[s[z]]=N[u]break end end end end if e>=z(1,C-1)then for u=C,v,1 do C=C+1 if c(e,r[u])~=l then P[u]=true end end end for u,c in pairs(u)do local N=L[u]if N~=nil and(c~=nil and not P[N])then x[u]=c end end return x end local function a(c,N,z,r,l)local w={}local P={}for u,c in ipairs(N)do w[c]=u table.insert(P,c)end local A=table.getn(P)local a={Encode=function(u)return C(u,P)end,Decode=function(u)return V(u,P,A)end;Diff=function(u,c)return Q(u,c,P)end,Patch=function(u,c)return n(u,c,P,w,A)end}if z==nil then a.Send=e a.Acknowledge=e a.RTT=function()return 0 end else local N local e="\078\067\082\067\084\095"..c l=l~=false if u:IsServer()then if game.ReplicatedStorage:FindFirstChild(e)then error("\084\104\101\114\101 \105\115 \097\108\114\101\097\100\121 \097\110 \101\118\101\110\116 \119\105\116\104 \116\104\101 \103\105\118\101\110 \073\068 \040"..(e.."\041"))end N=Instance.new("\082\101\109\111\116\101\069\118\101\110\116")N.Parent=game.ReplicatedStorage N.Name=e local u={}local function c(c,N)local z=N.UserId if u[z]~=nil and u[z][c]~=nil then if v[z]==nil then v[z]={LastRttTime=-math.huge,RTT=0}end local N=v[z]local r=u[z][c]if r>N.LastRttTime then local u=os.clock()-r if N.RTT==0 then N.RTT=u else N.RTT=s*u+L*N.RTT end N.LastRttTime=r end u[z][c]=nil end end N.OnServerEvent:Connect(function(u,s)local L=s[1]local v=s[2]if L==true then if v~=nil then if l then c(v,u)end if r~=nil then r(v,u,a)end end else if L~=nil then if l and v~=nil then N:FireClient(u,{true,v})end z(L,v,L[1]~=true,u,a)end end end)a.Send=function(c,z,r)if c==nil then return end if l and z~=nil then local c=r.UserId if u[c]==nil then u[c]={}end if u[c][z]==nil then u[c][z]=os.clock()end end N:FireClient(r,{c,z})end a.Acknowledge=function(u,c)N:FireClient(c,{true,u})end a.RTT=function(u)local c=v[u.UserId]if c~=nil then return c.RTT end return 0 end else N=game.ReplicatedStorage:WaitForChild(e)local u={}local c=-math.huge local function v(N)if u[N]~=nil then local z=u[N]if z>c then local u=os.clock()-z if x==0 then x=u else x=s*u+L*x end c=z end u[N]=nil end end N.OnClientEvent:Connect(function(u)local c=u[1]local s=u[2]if c==true then if s~=nil then if l then v(s)end if r~=nil then r(s,nil,a)end end else if c~=nil then if l and s~=nil then N:FireServer({true;s})end z(c,s,c[1]~=true,nil,a)end end end)a.Send=function(c,z)if c==nil then return end if l and z~=nil then if u[z]==nil then u[z]=os.clock()end end N:FireServer({c;z})end a.Acknowledge=function(u)N:FireServer({true,u})end a.RTT=function()return x end end end return a end return a
--[[
	NetworkContract v1.1 [2020-12-02 14:30]

   Facilitates Client Server communication through Events. Has Encode, Decode, Diff, Patch and Message Knowledge

	This is a minified version of NetworkContract, to see the full source code visit
	https://github.com/nidorx/roblox-network-contract

	Discussions about this script are at https://devforum.roblox.com/t/900276

	This code was minified using https://goonlinetools.com/lua-minifier/

	------------------------------------------------------------------------------

	MIT License

   Copyright (c) 2020 Alex Rodin

   Permission is hereby granted, free of charge, to any person obtaining a copy
   of this software and associated documentation files (the "Software"), to deal
   in the Software without restriction, including without limitation the rights
   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   copies of the Software, and to permit persons to whom the Software is
   furnished to do so, subject to the following conditions:

   The above copyright notice and this permission notice shall be included in all
   copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
   SOFTWARE.
]]
local a=game:GetService('RunService')local b=bit32.band;local c=bit32.bor;local d=bit32.lshift;local e={}local f=0x0;for g=0,31 do table.insert(e,d(1,g))end;local h=0.2;local i=1-h;local j={}local k=0;local function l()end;local m=0.00001;local function n(o,p)if o==p then return true end;return math.abs(o-p)<m end;local function q(r,s)if r==s then return true end;if not r.Position:FuzzyEq(s.Position)then return false end;if not r.LookVector:FuzzyEq(s.LookVector)then return false end;if not r.RightVector:FuzzyEq(s.RightVector)then return false end;if not r.UpVector:FuzzyEq(s.UpVector)then return false end;return true end;local function t(u,v)local w=f;local x={true,w}for y,z in ipairs(v)do local A=u[z]if A~=nil then w=c(w,e[y])table.insert(x,A)end end;x[2]=w;return x end;local function B(u,v,C)if not u then return{}end;local x={}local D=table.getn(u)local w=u[2]local E=1;for g=3,D do for F=E,C do E=E+1;if b(w,e[F])~=f then x[v[F]]=u[g]break end end end;return x end;local function G(H,I,v)local J=f;local K=f;local x={K,J}for y,z in ipairs(v)do local L=H[z]local M=I[z]if L==nil then if M~=nil then J=c(J,e[y])table.insert(x,M)end elseif M==nil then K=c(K,e[y])else local N=typeof(L)local O=typeof(M)local P=false;if N==O then if N=='number'and not n(L,M)then P=true elseif N=='Vector3'and not L:FuzzyEq(M)then P=true elseif N=='CFrame'and not q(L,M)then P=true elseif L~=M then P=true end elseif L~=M then P=true end;if P then J=c(J,e[y])table.insert(x,M)end end end;x[1]=K;x[2]=J;return x end;local function Q(H,R,v,S,C)if not R then R={f,f}end;if not H then H={}end;local x={}local K=R[1]local J=R[2]local T={}local D=table.getn(R)local E=1;if J~=f then for g=3,D do for F=E,C do E=E+1;local U=e[F]if b(K,U)~=f then T[F]=true elseif b(J,U)~=f then T[F]=true;x[v[F]]=R[g]break end end end end;if K>=d(1,E-1)then for F=E,C do E=E+1;if b(K,e[F])~=f then T[F]=true end end end;for z,A in pairs(H)do local y=S[z]if y~=nil and A~=nil and not T[y]then x[z]=A end end;return x end;local function V(W,X,Y,Z,_)local S={}local v={}for y,z in ipairs(X)do S[z]=y;table.insert(v,z)end;local C=table.getn(v)local a0={Encode=function(u)return t(u,v)end,Decode=function(u)return B(u,v,C)end,Diff=function(H,I)return G(H,I,v)end,Patch=function(H,R)return Q(H,R,v,S,C)end}if Y==nil then a0.Send=l;a0.Acknowledge=l;a0.RTT=function()return 0 end else local a1;local a2='NCRCT_'..W;_=_~=false;if a:IsServer()then if game.ReplicatedStorage:FindFirstChild(a2)then error('There is already an event with the given ID ('..a2 ..')')end;a1=Instance.new('RemoteEvent')a1.Parent=game.ReplicatedStorage;a1.Name=a2;local a3={}local function a4(a5,a6)local a7=a6.UserId;if a3[a7]~=nil and a3[a7][a5]~=nil then if j[a7]==nil then j[a7]={LastRttTime=-math.huge,RTT=0}end;local a8=j[a7]local a9=a3[a7][a5]if a9>a8.LastRttTime then local aa=os.clock()-a9;if a8.RTT==0 then a8.RTT=aa else a8.RTT=h*aa+i*a8.RTT end;a8.LastRttTime=a9 end;a3[a7][a5]=nil end end;a1.OnServerEvent:Connect(function(a6,ab)local u=ab[1]local a5=ab[2]if u==true then if a5~=nil then if _ then a4(a5,a6)end;if Z~=nil then Z(a5,a6,a0)end end else if u~=nil then if _ and a5~=nil then a1:FireClient(a6,{true,a5})end;Y(u,a5,u[1]~=true,a6,a0)end end end)a0.Send=function(u,a5,a6)if u==nil then return end;if _ and a5~=nil then local a7=a6.UserId;if a3[a7]==nil then a3[a7]={}end;if a3[a7][a5]==nil then a3[a7][a5]=os.clock()end end;a1:FireClient(a6,{u,a5})end;a0.Acknowledge=function(ac,a6)a1:FireClient(a6,{true,ac})end;a0.RTT=function(a6)local a8=j[a6.UserId]if a8~=nil then return a8.RTT end;return 0 end else a1=game.ReplicatedStorage:WaitForChild(a2)local a3={}local ad=-math.huge;local function a4(a5)if a3[a5]~=nil then local a9=a3[a5]if a9>ad then local aa=os.clock()-a9;if k==0 then k=aa else k=h*aa+i*k end;ad=a9 end;a3[a5]=nil end end;a1.OnClientEvent:Connect(function(ab)local u=ab[1]local a5=ab[2]if u==true then if a5~=nil then if _ then a4(a5)end;if Z~=nil then Z(a5,nil,a0)end end else if u~=nil then if _ and a5~=nil then a1:FireServer({true,a5})end;Y(u,a5,u[1]~=true,nil,a0)end end end)a0.Send=function(u,a5)if u==nil then return end;if _ and a5~=nil then if a3[a5]==nil then a3[a5]=os.clock()end end;a1:FireServer({u,a5})end;a0.Acknowledge=function(ac)a1:FireServer({true,ac})end;a0.RTT=function()return k end end end;return a0 end;return V