local J=game:GetService("\080\108\097\121\101\114\115")local H=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local Q=require(H.Packages.TableToBuffer)do local J=buffer.create(4096)buffer.fill(J,0,4503599627370495,4096)local H=(((((Q.GetDeserializerBuilder()).booleanWithName("\072\101\108\108\111\086\097\108\117\101")).floatWithName("\115\105\099\107\070\108\111\097\116")).uint32WithName("\084\104\105\115 \105\110\116\101\103\101\114 \105\115 \105\110\115\097\110\101")).tableWithName("\083\105\099\107\078\101\115\116\101\100\084\097\098\108\101\084\119\105\099\101",Q.GetSerializerForTable({Crooked=true,Insanity=false;Rapp="\065\066\066\065\065\066\065\066\066\066\065\066\065\066\065\066\065\066\065\066\066\065\066\065\066\065\066\065\066\065\066\066\065\066\065\066\065";Sicka="\066\065\066\065\066\065\066\065\066\066\065\066\065\066\083\085\068\072\073\065\072\068\073\085\065\083\072\068\073\080\085\065\072\083\068\072\065\083\068\072\065\083";this_is_crazy=1451;testingMoreValues=0;NestedTwice={ne="\115\116\101\100";vec=Vector3.new(1541,12.211564,402342);vec3=Vector3.new(545.1456,54654.458,-259259.89023489);CFram=CFrame.identity,buf=J}}))).build()local m=((((Q.GetDeserializerBuilder()).booleanWithName("\084\101\115\116\095\086\097\108\117\101")).int32WithName("\065\109\111\110\103\085\115")).tableWithName("\078\101\115\116\101\100\083\101\114\105\097\108\105\122\101\114",H)).build()local D={HelloValue=false,sickFloat=.3784,["\084\104\105\115 \105\110\116\101\103\101\114 \105\115 \105\110\115\097\110\101"]=4551;SickNestedTableTwice={Crooked=false,Insanity=true;Rapp="\083\073\071\078\065\084\085\082\069\069\069\069\069";Sicka="\085\078\083\073\071\078\065\084\085\082\069\069\069\069\069\069\069\069";this_is_crazy=456156168451.11,testingMoreValues=1215.11;NestedTwice={ne="\117\110\115\116\101\100",vec=Vector3.new(545.1456,54654.458,-259259.89023489),vec3=Vector3.new(584545.1456,121588.458,-2259.890238811),CFram=CFrame.new(8568.478,564568.47,54684658.184);buf=J}}}local n={Test_Value=true;AmongUs=450235654;NestedSerializer=table.clone(D)}end do print("-- \084\097\098\108\101 \097\115 \066\117\102\102\101\114 \112\114\105\110\116 \116\101\115\116 --")local H=Q.TableAsBuffer({ThisIsAnIndex={AnotherIndex="",AnotherExtraIndex={Key=string.rep("\067",1024)}},ThisIsAnotherIndex="\072\101\108\108\111\044 \087\111\114\108\100\033";ThisisACframe=((J.LocalPlayer.Character or J.LocalPlayer.CharacterAdded:Wait()):WaitForChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")).CFrame;ThisIsAVector=Vector3.new(416064,1,3735928559);ThisIsABoolean=false})print(tostring(H))print(((J.LocalPlayer.Character or J.LocalPlayer.CharacterAdded:Wait()):WaitForChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")).CFrame)print(tostring(H.ThisisACframe))H.ThisIsAnIndex={AnotherIndex="\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065\065";AnotherExtraIndex={Key=string.rep("\065",1024)}}print(tostring(H))H.ThisIsABoolean=true print(tostring(H))H.ThisIsAnIndex={AnotherIndex="\084\072\073\083 \073\083 \065 \078\079\082\077\065\076 \083\084\082\073\078\071";AnotherExtraIndex={Key=string.rep("\066",1024)}}print(tostring(H))end
--!nocheck

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local tableToBuffer = require(ReplicatedStorage.Packages.TableToBuffer)

do
	local buf = buffer.create(0x1000)
	buffer.fill(buf, 0x0, 0xfffffffffffff, 0x1000)
	local serializer_1 = tableToBuffer
		.GetDeserializerBuilder()
		.booleanWithName("HelloValue")
		.floatWithName("sickFloat")
		.uint32WithName("This integer is insane")
		.tableWithName(
			"SickNestedTableTwice",
			tableToBuffer.GetSerializerForTable({
				Crooked = true,
				Insanity = false,
				Rapp = "ABBAABABBBABABABABABBABABABABABBABABA",
				Sicka = "BABABABABBABABSUDHIAHDIUASHDIPUAHSDHASDHAS",
				this_is_crazy = 1451,
				testingMoreValues = 0,
				NestedTwice = {
					ne = "sted",
					vec = Vector3.new(1541, 12.211564, 402342),
					vec3 = Vector3.new(545.1456, 54654.458, -259259.89023489),
					CFram = CFrame.identity,
					buf = buf,
				},
			})
		)
		.build()

	local serializer_2 = tableToBuffer
		.GetDeserializerBuilder()
		.booleanWithName("Test_Value")
		.int32WithName("AmongUs")
		.tableWithName("NestedSerializer", serializer_1)
		.build()

	local table_1 = {
		HelloValue = false,
		sickFloat = 0.3784,
		["This integer is insane"] = 4551,
		SickNestedTableTwice = {
			Crooked = false,
			Insanity = true,
			Rapp = "SIGNATUREEEEE",
			Sicka = "UNSIGNATUREEEEEEEE",
			this_is_crazy = 456156168451.11,
			testingMoreValues = 1215.11,
			NestedTwice = {
				ne = "unsted",
				vec = Vector3.new(545.1456, 54654.458, -259259.89023489),
				vec3 = Vector3.new(584545.1456, 121588.458, -2259.890238811),
				CFram = CFrame.new(8568.478, 564568.47, 54684658.184),
				buf = buf,
			},
		},
	}

	local table_2 = {
		Test_Value = true,
		AmongUs = 450235654,
		NestedSerializer = table.clone(table_1),
	}

	--print(buffer.tostring(serializer_1.Serialize(table_1)))
	--print(serializer_1.Deserialize(serializer_1.Serialize(table_1)))

	--print(buffer.tostring(serializer_2.Serialize(table_2)))
	--print(serializer_2.Deserialize(serializer_2.Serialize(table_2)))
end

do
	print("-- Table as Buffer print test --")
	local tableAsBuffer = tableToBuffer.TableAsBuffer({
		ThisIsAnIndex = {
			AnotherIndex = "",
			AnotherExtraIndex = {
				Key = string.rep("C", 1024),
			},
		},
		ThisIsAnotherIndex = "Hello, World!",
		ThisisACframe = (Players.LocalPlayer.Character or Players.LocalPlayer.CharacterAdded:Wait()):WaitForChild(
			"HumanoidRootPart"
		).CFrame,
		ThisIsAVector = Vector3.new(0x65940, 01, 0xDEADBEEF),
		ThisIsABoolean = false,
	})
	print(tostring(tableAsBuffer))
	print(
		(Players.LocalPlayer.Character or Players.LocalPlayer.CharacterAdded:Wait()):WaitForChild("HumanoidRootPart").CFrame
	)
	print(tostring(tableAsBuffer.ThisisACframe))

	tableAsBuffer.ThisIsAnIndex = {
		AnotherIndex = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
		AnotherExtraIndex = { Key = string.rep("A", 1024) },
	}

	print(tostring(tableAsBuffer))

	tableAsBuffer.ThisIsABoolean = true
	print(tostring(tableAsBuffer))
	tableAsBuffer.ThisIsAnIndex = {
		AnotherIndex = "THIS IS A NORMAL STRING",
		AnotherExtraIndex = {
			Key = string.rep("B", 1024),
		},
	}

	print(tostring(tableAsBuffer))
end
