@kunosyn/shatterbox 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4425 @@
1
+ --!strict
2
+ --!native
3
+ --!optimize 2
4
+ --!nolint LocalShadow
5
+ --#selene: allow(shadowing)
6
+ -- File generated by Blink v0.17.4 (https://github.com/1Axen/Blink)
7
+ -- This file is not meant to be edited
8
+
9
+ local Players = game:GetService("Players")
10
+ local ReplicatedStorage = game:GetService("ReplicatedStorage")
11
+ local RunService = game:GetService("RunService")
12
+
13
+ local BASE_EVENT_NAME = "BLINK"
14
+ local Invocations = 0
15
+
16
+ local SendSize = 64
17
+ local SendOffset = 0
18
+ local SendCursor = 0
19
+ local SendBuffer = buffer.create(64)
20
+ local SendInstances = {}
21
+
22
+ local RecieveCursor = 0
23
+ local RecieveBuffer = buffer.create(64)
24
+
25
+ local RecieveInstances = {}
26
+ local RecieveInstanceCursor = 0
27
+
28
+ local Null = newproxy()
29
+
30
+ type Entry = {
31
+ value: any,
32
+ next: Entry?
33
+ }
34
+
35
+ type Queue = {
36
+ head: Entry?,
37
+ tail: Entry?
38
+ }
39
+
40
+ type BufferSave = {
41
+ Size: number,
42
+ Cursor: number,
43
+ Buffer: buffer,
44
+ Instances: {Instance}
45
+ }
46
+
47
+ local function Read(Bytes: number)
48
+ local Offset = RecieveCursor
49
+ RecieveCursor += Bytes
50
+ return Offset
51
+ end
52
+
53
+ local function Save(): BufferSave
54
+ return {
55
+ Size = SendSize,
56
+ Cursor = SendCursor,
57
+ Buffer = SendBuffer,
58
+ Instances = SendInstances
59
+ }
60
+ end
61
+
62
+ local function Load(Save: BufferSave?)
63
+ if Save then
64
+ SendSize = Save.Size
65
+ SendCursor = Save.Cursor
66
+ SendOffset = Save.Cursor
67
+ SendBuffer = Save.Buffer
68
+ SendInstances = Save.Instances
69
+ return
70
+ end
71
+
72
+ SendSize = 64
73
+ SendCursor = 0
74
+ SendOffset = 0
75
+ SendBuffer = buffer.create(64)
76
+ SendInstances = {}
77
+ end
78
+
79
+ local function Invoke()
80
+ if Invocations == 255 then
81
+ Invocations = 0
82
+ end
83
+
84
+ local Invocation = Invocations
85
+ Invocations += 1
86
+ return Invocation
87
+ end
88
+
89
+ local function Allocate(Bytes: number)
90
+ local InUse = (SendCursor + Bytes)
91
+ if InUse > SendSize then
92
+ --> Avoid resizing the buffer for every write
93
+ while InUse > SendSize do
94
+ SendSize *= 1.5
95
+ end
96
+
97
+ local Buffer = buffer.create(SendSize)
98
+ buffer.copy(Buffer, 0, SendBuffer, 0, SendCursor)
99
+ SendBuffer = Buffer
100
+ end
101
+
102
+ SendOffset = SendCursor
103
+ SendCursor += Bytes
104
+
105
+ return SendOffset
106
+ end
107
+
108
+ local function CreateQueue(): Queue
109
+ return {
110
+ head = nil,
111
+ tail = nil
112
+ }
113
+ end
114
+
115
+ local function Pop(queue: Queue): any
116
+ local head = queue.head
117
+ if head == nil then
118
+ return
119
+ end
120
+
121
+ queue.head = head.next
122
+ return head.value
123
+ end
124
+
125
+ local function Push(queue: Queue, value: any)
126
+ local entry: Entry = {
127
+ value = value,
128
+ next = nil
129
+ }
130
+
131
+ if queue.tail ~= nil then
132
+ queue.tail.next = entry
133
+ end
134
+
135
+ queue.tail = entry
136
+
137
+ if queue.head == nil then
138
+ queue.head = entry
139
+ end
140
+ end
141
+
142
+ local Calls = table.create(256)
143
+
144
+ local Events: any = {
145
+ Reliable = table.create(256),
146
+ Unreliable = table.create(256)
147
+ }
148
+
149
+ local Queue: any = {
150
+ Reliable = table.create(256),
151
+ Unreliable = table.create(256)
152
+ }
153
+
154
+ Events.Reliable[5] = {}
155
+ Queue.Reliable[5] = table.create(256)
156
+ Queue.Reliable[9] = table.create(256)
157
+ export type Shatterbox_Vec2 = { number }
158
+ export type Shatterbox_Decal = { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? }
159
+ export type Shatterbox_Texture = { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? }
160
+ export type Shatterbox_Light = { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? }
161
+ export type Shatterbox_PartProperties = { Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }
162
+ export type Shatterbox_Box = { CFrame: CFrame, Size: Vector3 }
163
+ export type Shatterbox_Hitbox = { CFrame: CFrame, Size: Vector3, Shape: number }
164
+ export type Shatterbox_PartInstance = { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }
165
+ export type Shatterbox_Puppet = { GUID: string, CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }
166
+ export type Shatterbox_DestructionParamsType = { ID: string, CuttingPart: { CFrame: CFrame, Size: Vector3, Shape: number }, FilterTagged: { string }?, GridSize: number?, CleanupDelay: number?, SkipWalls: boolean?, SkipFloors: boolean?, SkipEncapsulatedVoxels: boolean?, OnVoxelDestruct: string?, UserData: any? }
167
+ export type Shatterbox_PuppetState = { GUID: string, CFrame: CFrame }
168
+ local function Shatterbox_WriteEVENT_SignalClearQueue(Value: nil): ()
169
+ -- Allocate BLOCK: 1 bytes
170
+ local BLOCK_START = Allocate(1)
171
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, 0)
172
+ end
173
+
174
+ local function Shatterbox_WriteEVENT_SignalReset(Value: boolean): ()
175
+ -- Allocate BLOCK: 2 bytes
176
+ local BLOCK_START = Allocate(2)
177
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, 1)
178
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Value and 1 or 0)
179
+ end
180
+
181
+ local function Shatterbox_WriteEVENT_SignalResetArea(Value1: CFrame, Value2: Vector3): ()
182
+ -- Allocate BLOCK: 37 bytes
183
+ local BLOCK_START = Allocate(37)
184
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, 2)
185
+ local Vector = Value1.Position
186
+ buffer.writef32(SendBuffer, BLOCK_START + 1, Vector.X)
187
+ buffer.writef32(SendBuffer, BLOCK_START + 5, Vector.Y)
188
+ buffer.writef32(SendBuffer, BLOCK_START + 9, Vector.Z)
189
+ local rX, rY, rZ = Value1:ToOrientation()
190
+ buffer.writef32(SendBuffer, BLOCK_START + 13, rX)
191
+ buffer.writef32(SendBuffer, BLOCK_START + 17, rY)
192
+ buffer.writef32(SendBuffer, BLOCK_START + 21, rZ)
193
+ local Vector = Value2
194
+ buffer.writef32(SendBuffer, BLOCK_START + 25, Vector.X)
195
+ buffer.writef32(SendBuffer, BLOCK_START + 29, Vector.Y)
196
+ buffer.writef32(SendBuffer, BLOCK_START + 33, Vector.Z)
197
+ end
198
+
199
+ local function Shatterbox_WriteEVENT_CreatePuppets(Value: { { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } } }): ()
200
+ -- Allocate BLOCK: 3 bytes
201
+ local BLOCK_START = Allocate(3)
202
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, 3)
203
+ -- START ARRAY
204
+ buffer.writeu16(SendBuffer, BLOCK_START + 1, #Value)
205
+ -- Allocate BLOCK: 56 bytes
206
+ local ARRAY_START_1 = Allocate(56 * #Value)
207
+ for Index = 1, #Value do
208
+ local Item_1 = Value[Index]
209
+ local Vector = Item_1.CFrame.Position
210
+ -- Allocate 4
211
+ local OPERATION_OFFSET_0 = ARRAY_START_1
212
+ ARRAY_START_1 += 4
213
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Vector.X)
214
+ -- Allocate 4
215
+ local OPERATION_OFFSET_1 = ARRAY_START_1
216
+ ARRAY_START_1 += 4
217
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_1, Vector.Y)
218
+ -- Allocate 4
219
+ local OPERATION_OFFSET_2 = ARRAY_START_1
220
+ ARRAY_START_1 += 4
221
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_2, Vector.Z)
222
+ local rX, rY, rZ = Item_1.CFrame:ToOrientation()
223
+ -- Allocate 4
224
+ local OPERATION_OFFSET_3 = ARRAY_START_1
225
+ ARRAY_START_1 += 4
226
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_3, rX)
227
+ -- Allocate 4
228
+ local OPERATION_OFFSET_4 = ARRAY_START_1
229
+ ARRAY_START_1 += 4
230
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_4, rY)
231
+ -- Allocate 4
232
+ local OPERATION_OFFSET_5 = ARRAY_START_1
233
+ ARRAY_START_1 += 4
234
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_5, rZ)
235
+ local Vector = Item_1.Size
236
+ -- Allocate 4
237
+ local OPERATION_OFFSET_6 = ARRAY_START_1
238
+ ARRAY_START_1 += 4
239
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_6, Vector.X)
240
+ -- Allocate 4
241
+ local OPERATION_OFFSET_7 = ARRAY_START_1
242
+ ARRAY_START_1 += 4
243
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_7, Vector.Y)
244
+ -- Allocate 4
245
+ local OPERATION_OFFSET_8 = ARRAY_START_1
246
+ ARRAY_START_1 += 4
247
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_8, Vector.Z)
248
+ -- Allocate 1
249
+ local OPERATION_OFFSET_9 = ARRAY_START_1
250
+ ARRAY_START_1 += 1
251
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_9, Item_1.Anchored and 1 or 0)
252
+ -- Allocate 1
253
+ local OPERATION_OFFSET_10 = ARRAY_START_1
254
+ ARRAY_START_1 += 1
255
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_10, Item_1.Color ~= nil and 1 or 0)
256
+ if Item_1.Color ~= nil then
257
+ -- Allocate BLOCK: 3 bytes
258
+ local BLOCK_START = Allocate(3)
259
+ local Color = Item_1.Color
260
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
261
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
262
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
263
+ end
264
+ -- Allocate 1
265
+ local OPERATION_OFFSET_11 = ARRAY_START_1
266
+ ARRAY_START_1 += 1
267
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_11, Item_1.Material ~= nil and 1 or 0)
268
+ if Item_1.Material ~= nil then
269
+ -- Allocate BLOCK: 2 bytes
270
+ local BLOCK_START = Allocate(2)
271
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Item_1.Material)
272
+ end
273
+ -- Allocate 1
274
+ local OPERATION_OFFSET_12 = ARRAY_START_1
275
+ ARRAY_START_1 += 1
276
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_12, Item_1.Transparency ~= nil and 1 or 0)
277
+ if Item_1.Transparency ~= nil then
278
+ -- Allocate BLOCK: 2 bytes
279
+ local BLOCK_START = Allocate(2)
280
+ if Item_1.Transparency > 65504 then
281
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b0_11111_0000000000)
282
+ elseif Item_1.Transparency < -65504 then
283
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000000)
284
+ elseif Item_1.Transparency ~= Item_1.Transparency then
285
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000001)
286
+ elseif Item_1.Transparency == 0 then
287
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0)
288
+ else
289
+ local float = Item_1.Transparency
290
+ local Abosulte = math.abs(float)
291
+ local Interval = math.ldexp(1, math.floor(math.log(Abosulte, 2)) - 10)
292
+ local RoundedValue = (Abosulte // Interval) * Interval
293
+ local Fraction, Exponent = math.frexp(RoundedValue)
294
+ Exponent += 14
295
+ local Mantissa = math.round(if Exponent <= 0
296
+ then Fraction * 0x400 / math.ldexp(1, math.abs(Exponent))
297
+ else Fraction * 0x800) % 0x400
298
+ local Result = Mantissa
299
+ + math.max(Exponent, 0) * 0x400
300
+ + if float < 0 then 0x8000 else 0
301
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Result)
302
+ end
303
+ end
304
+ -- Allocate 1
305
+ local OPERATION_OFFSET_13 = ARRAY_START_1
306
+ ARRAY_START_1 += 1
307
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_13, Item_1.Reflectance ~= nil and 1 or 0)
308
+ if Item_1.Reflectance ~= nil then
309
+ -- Allocate BLOCK: 2 bytes
310
+ local BLOCK_START = Allocate(2)
311
+ if Item_1.Reflectance > 65504 then
312
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b0_11111_0000000000)
313
+ elseif Item_1.Reflectance < -65504 then
314
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000000)
315
+ elseif Item_1.Reflectance ~= Item_1.Reflectance then
316
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000001)
317
+ elseif Item_1.Reflectance == 0 then
318
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0)
319
+ else
320
+ local float = Item_1.Reflectance
321
+ local Abosulte = math.abs(float)
322
+ local Interval = math.ldexp(1, math.floor(math.log(Abosulte, 2)) - 10)
323
+ local RoundedValue = (Abosulte // Interval) * Interval
324
+ local Fraction, Exponent = math.frexp(RoundedValue)
325
+ Exponent += 14
326
+ local Mantissa = math.round(if Exponent <= 0
327
+ then Fraction * 0x400 / math.ldexp(1, math.abs(Exponent))
328
+ else Fraction * 0x800) % 0x400
329
+ local Result = Mantissa
330
+ + math.max(Exponent, 0) * 0x400
331
+ + if float < 0 then 0x8000 else 0
332
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Result)
333
+ end
334
+ end
335
+ -- Allocate 1
336
+ local OPERATION_OFFSET_14 = ARRAY_START_1
337
+ ARRAY_START_1 += 1
338
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_14, Item_1.MaterialVariant ~= nil and 1 or 0)
339
+ if Item_1.MaterialVariant ~= nil then
340
+ -- Allocate BLOCK: 2 bytes
341
+ local BLOCK_START = Allocate(2)
342
+ local Length = #Item_1.MaterialVariant
343
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
344
+ Allocate(Length)
345
+ buffer.writestring(SendBuffer, SendOffset, Item_1.MaterialVariant, Length)
346
+ end
347
+ -- Allocate 1
348
+ local OPERATION_OFFSET_15 = ARRAY_START_1
349
+ ARRAY_START_1 += 1
350
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_15, Item_1.CollisionGroup ~= nil and 1 or 0)
351
+ if Item_1.CollisionGroup ~= nil then
352
+ -- Allocate BLOCK: 2 bytes
353
+ local BLOCK_START = Allocate(2)
354
+ local Length = #Item_1.CollisionGroup
355
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
356
+ Allocate(Length)
357
+ buffer.writestring(SendBuffer, SendOffset, Item_1.CollisionGroup, Length)
358
+ end
359
+ -- Allocate 1
360
+ local OPERATION_OFFSET_16 = ARRAY_START_1
361
+ ARRAY_START_1 += 1
362
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_16, Item_1.LeftSurface ~= nil and 1 or 0)
363
+ if Item_1.LeftSurface ~= nil then
364
+ -- Allocate BLOCK: 1 bytes
365
+ local BLOCK_START = Allocate(1)
366
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_1.LeftSurface)
367
+ end
368
+ -- Allocate 1
369
+ local OPERATION_OFFSET_17 = ARRAY_START_1
370
+ ARRAY_START_1 += 1
371
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_17, Item_1.RightSurface ~= nil and 1 or 0)
372
+ if Item_1.RightSurface ~= nil then
373
+ -- Allocate BLOCK: 1 bytes
374
+ local BLOCK_START = Allocate(1)
375
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_1.RightSurface)
376
+ end
377
+ -- Allocate 1
378
+ local OPERATION_OFFSET_18 = ARRAY_START_1
379
+ ARRAY_START_1 += 1
380
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_18, Item_1.FrontSurface ~= nil and 1 or 0)
381
+ if Item_1.FrontSurface ~= nil then
382
+ -- Allocate BLOCK: 1 bytes
383
+ local BLOCK_START = Allocate(1)
384
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_1.FrontSurface)
385
+ end
386
+ -- Allocate 1
387
+ local OPERATION_OFFSET_19 = ARRAY_START_1
388
+ ARRAY_START_1 += 1
389
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_19, Item_1.BackSurface ~= nil and 1 or 0)
390
+ if Item_1.BackSurface ~= nil then
391
+ -- Allocate BLOCK: 1 bytes
392
+ local BLOCK_START = Allocate(1)
393
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_1.BackSurface)
394
+ end
395
+ -- Allocate 1
396
+ local OPERATION_OFFSET_20 = ARRAY_START_1
397
+ ARRAY_START_1 += 1
398
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_20, Item_1.TopSurface ~= nil and 1 or 0)
399
+ if Item_1.TopSurface ~= nil then
400
+ -- Allocate BLOCK: 1 bytes
401
+ local BLOCK_START = Allocate(1)
402
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_1.TopSurface)
403
+ end
404
+ -- Allocate 1
405
+ local OPERATION_OFFSET_21 = ARRAY_START_1
406
+ ARRAY_START_1 += 1
407
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_21, Item_1.BottomSurface ~= nil and 1 or 0)
408
+ if Item_1.BottomSurface ~= nil then
409
+ -- Allocate BLOCK: 1 bytes
410
+ local BLOCK_START = Allocate(1)
411
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_1.BottomSurface)
412
+ end
413
+ -- Allocate 1
414
+ local OPERATION_OFFSET_22 = ARRAY_START_1
415
+ ARRAY_START_1 += 1
416
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_22, Item_1.Textures ~= nil and 1 or 0)
417
+ if Item_1.Textures ~= nil then
418
+ -- Allocate BLOCK: 2 bytes
419
+ local BLOCK_START = Allocate(2)
420
+ -- START ARRAY
421
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Item_1.Textures)
422
+ -- Allocate BLOCK: 11 bytes
423
+ local ARRAY_START_3 = Allocate(11 * #Item_1.Textures)
424
+ for Index = 1, #Item_1.Textures do
425
+ local Item_3 = Item_1.Textures[Index]
426
+ -- Allocate 1
427
+ local OPERATION_OFFSET_0 = ARRAY_START_3
428
+ ARRAY_START_3 += 1
429
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_0, Item_3.Color3 ~= nil and 1 or 0)
430
+ if Item_3.Color3 ~= nil then
431
+ -- Allocate BLOCK: 3 bytes
432
+ local BLOCK_START = Allocate(3)
433
+ local Color = Item_3.Color3
434
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
435
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
436
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
437
+ end
438
+ -- Allocate 1
439
+ local OPERATION_OFFSET_1 = ARRAY_START_3
440
+ ARRAY_START_3 += 1
441
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_3.ColorMap ~= nil and 1 or 0)
442
+ if Item_3.ColorMap ~= nil then
443
+ -- Allocate BLOCK: 2 bytes
444
+ local BLOCK_START = Allocate(2)
445
+ local Length = #Item_3.ColorMap
446
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
447
+ Allocate(Length)
448
+ buffer.writestring(SendBuffer, SendOffset, Item_3.ColorMap, Length)
449
+ end
450
+ -- Allocate 1
451
+ local OPERATION_OFFSET_2 = ARRAY_START_3
452
+ ARRAY_START_3 += 1
453
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_3.Transparency ~= nil and 1 or 0)
454
+ if Item_3.Transparency ~= nil then
455
+ -- Allocate BLOCK: 4 bytes
456
+ local BLOCK_START = Allocate(4)
457
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Transparency)
458
+ end
459
+ -- Allocate 1
460
+ local OPERATION_OFFSET_3 = ARRAY_START_3
461
+ ARRAY_START_3 += 1
462
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_3.UVOffset ~= nil and 1 or 0)
463
+ if Item_3.UVOffset ~= nil then
464
+ -- START ARRAY
465
+ -- Allocate BLOCK: 4 bytes
466
+ local ARRAY_START_5 = Allocate(4 * 2)
467
+ for Index = 1, 2 do
468
+ local Item_5 = Item_3.UVOffset[Index]
469
+ -- Allocate 4
470
+ local OPERATION_OFFSET_0 = ARRAY_START_5
471
+ ARRAY_START_5 += 4
472
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
473
+ end
474
+ -- END ARRAY
475
+ end
476
+ -- Allocate 1
477
+ local OPERATION_OFFSET_4 = ARRAY_START_3
478
+ ARRAY_START_3 += 1
479
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_3.UVScale ~= nil and 1 or 0)
480
+ if Item_3.UVScale ~= nil then
481
+ -- START ARRAY
482
+ -- Allocate BLOCK: 4 bytes
483
+ local ARRAY_START_5 = Allocate(4 * 2)
484
+ for Index = 1, 2 do
485
+ local Item_5 = Item_3.UVScale[Index]
486
+ -- Allocate 4
487
+ local OPERATION_OFFSET_0 = ARRAY_START_5
488
+ ARRAY_START_5 += 4
489
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
490
+ end
491
+ -- END ARRAY
492
+ end
493
+ -- Allocate 1
494
+ local OPERATION_OFFSET_5 = ARRAY_START_3
495
+ ARRAY_START_3 += 1
496
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_3.ZIndex ~= nil and 1 or 0)
497
+ if Item_3.ZIndex ~= nil then
498
+ -- Allocate BLOCK: 4 bytes
499
+ local BLOCK_START = Allocate(4)
500
+ buffer.writeu32(SendBuffer, BLOCK_START + 0, Item_3.ZIndex)
501
+ end
502
+ -- Allocate 1
503
+ local OPERATION_OFFSET_6 = ARRAY_START_3
504
+ ARRAY_START_3 += 1
505
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_3.Face ~= nil and 1 or 0)
506
+ if Item_3.Face ~= nil then
507
+ -- Allocate BLOCK: 1 bytes
508
+ local BLOCK_START = Allocate(1)
509
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Face)
510
+ end
511
+ -- Allocate 1
512
+ local OPERATION_OFFSET_7 = ARRAY_START_3
513
+ ARRAY_START_3 += 1
514
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_7, Item_3.OffsetStudsU ~= nil and 1 or 0)
515
+ if Item_3.OffsetStudsU ~= nil then
516
+ -- Allocate BLOCK: 4 bytes
517
+ local BLOCK_START = Allocate(4)
518
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.OffsetStudsU)
519
+ end
520
+ -- Allocate 1
521
+ local OPERATION_OFFSET_8 = ARRAY_START_3
522
+ ARRAY_START_3 += 1
523
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_8, Item_3.OffsetStudsV ~= nil and 1 or 0)
524
+ if Item_3.OffsetStudsV ~= nil then
525
+ -- Allocate BLOCK: 4 bytes
526
+ local BLOCK_START = Allocate(4)
527
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.OffsetStudsV)
528
+ end
529
+ -- Allocate 1
530
+ local OPERATION_OFFSET_9 = ARRAY_START_3
531
+ ARRAY_START_3 += 1
532
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_9, Item_3.StudsPerTileU ~= nil and 1 or 0)
533
+ if Item_3.StudsPerTileU ~= nil then
534
+ -- Allocate BLOCK: 4 bytes
535
+ local BLOCK_START = Allocate(4)
536
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.StudsPerTileU)
537
+ end
538
+ -- Allocate 1
539
+ local OPERATION_OFFSET_10 = ARRAY_START_3
540
+ ARRAY_START_3 += 1
541
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_10, Item_3.StudsPerTileV ~= nil and 1 or 0)
542
+ if Item_3.StudsPerTileV ~= nil then
543
+ -- Allocate BLOCK: 4 bytes
544
+ local BLOCK_START = Allocate(4)
545
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.StudsPerTileV)
546
+ end
547
+ end
548
+ -- END ARRAY
549
+ end
550
+ -- Allocate 1
551
+ local OPERATION_OFFSET_23 = ARRAY_START_1
552
+ ARRAY_START_1 += 1
553
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_23, Item_1.Lights ~= nil and 1 or 0)
554
+ if Item_1.Lights ~= nil then
555
+ -- Allocate BLOCK: 2 bytes
556
+ local BLOCK_START = Allocate(2)
557
+ -- START ARRAY
558
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Item_1.Lights)
559
+ -- Allocate BLOCK: 8 bytes
560
+ local ARRAY_START_3 = Allocate(8 * #Item_1.Lights)
561
+ for Index = 1, #Item_1.Lights do
562
+ local Item_3 = Item_1.Lights[Index]
563
+ local Length = #Item_3.ClassName
564
+ -- Allocate 2
565
+ local OPERATION_OFFSET_0 = ARRAY_START_3
566
+ ARRAY_START_3 += 2
567
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_0, Length)
568
+ Allocate(Length)
569
+ buffer.writestring(SendBuffer, SendOffset, Item_3.ClassName, Length)
570
+ -- Allocate 1
571
+ local OPERATION_OFFSET_1 = ARRAY_START_3
572
+ ARRAY_START_3 += 1
573
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_3.Brightness ~= nil and 1 or 0)
574
+ if Item_3.Brightness ~= nil then
575
+ -- Allocate BLOCK: 4 bytes
576
+ local BLOCK_START = Allocate(4)
577
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Brightness)
578
+ end
579
+ -- Allocate 1
580
+ local OPERATION_OFFSET_2 = ARRAY_START_3
581
+ ARRAY_START_3 += 1
582
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_3.Color ~= nil and 1 or 0)
583
+ if Item_3.Color ~= nil then
584
+ -- Allocate BLOCK: 3 bytes
585
+ local BLOCK_START = Allocate(3)
586
+ local Color = Item_3.Color
587
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
588
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
589
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
590
+ end
591
+ -- Allocate 1
592
+ local OPERATION_OFFSET_3 = ARRAY_START_3
593
+ ARRAY_START_3 += 1
594
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_3.Shadows ~= nil and 1 or 0)
595
+ if Item_3.Shadows ~= nil then
596
+ -- Allocate BLOCK: 1 bytes
597
+ local BLOCK_START = Allocate(1)
598
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Shadows and 1 or 0)
599
+ end
600
+ -- Allocate 1
601
+ local OPERATION_OFFSET_4 = ARRAY_START_3
602
+ ARRAY_START_3 += 1
603
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_3.Range ~= nil and 1 or 0)
604
+ if Item_3.Range ~= nil then
605
+ -- Allocate BLOCK: 4 bytes
606
+ local BLOCK_START = Allocate(4)
607
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Range)
608
+ end
609
+ -- Allocate 1
610
+ local OPERATION_OFFSET_5 = ARRAY_START_3
611
+ ARRAY_START_3 += 1
612
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_3.Angle ~= nil and 1 or 0)
613
+ if Item_3.Angle ~= nil then
614
+ -- Allocate BLOCK: 4 bytes
615
+ local BLOCK_START = Allocate(4)
616
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Angle)
617
+ end
618
+ -- Allocate 1
619
+ local OPERATION_OFFSET_6 = ARRAY_START_3
620
+ ARRAY_START_3 += 1
621
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_3.Face ~= nil and 1 or 0)
622
+ if Item_3.Face ~= nil then
623
+ -- Allocate BLOCK: 1 bytes
624
+ local BLOCK_START = Allocate(1)
625
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Face)
626
+ end
627
+ end
628
+ -- END ARRAY
629
+ end
630
+ -- Allocate 1
631
+ local OPERATION_OFFSET_24 = ARRAY_START_1
632
+ ARRAY_START_1 += 1
633
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_24, Item_1.Decals ~= nil and 1 or 0)
634
+ if Item_1.Decals ~= nil then
635
+ -- Allocate BLOCK: 2 bytes
636
+ local BLOCK_START = Allocate(2)
637
+ -- START ARRAY
638
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Item_1.Decals)
639
+ -- Allocate BLOCK: 7 bytes
640
+ local ARRAY_START_3 = Allocate(7 * #Item_1.Decals)
641
+ for Index = 1, #Item_1.Decals do
642
+ local Item_3 = Item_1.Decals[Index]
643
+ -- Allocate 1
644
+ local OPERATION_OFFSET_0 = ARRAY_START_3
645
+ ARRAY_START_3 += 1
646
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_0, Item_3.Color3 ~= nil and 1 or 0)
647
+ if Item_3.Color3 ~= nil then
648
+ -- Allocate BLOCK: 3 bytes
649
+ local BLOCK_START = Allocate(3)
650
+ local Color = Item_3.Color3
651
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
652
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
653
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
654
+ end
655
+ -- Allocate 1
656
+ local OPERATION_OFFSET_1 = ARRAY_START_3
657
+ ARRAY_START_3 += 1
658
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_3.ColorMap ~= nil and 1 or 0)
659
+ if Item_3.ColorMap ~= nil then
660
+ -- Allocate BLOCK: 2 bytes
661
+ local BLOCK_START = Allocate(2)
662
+ local Length = #Item_3.ColorMap
663
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
664
+ Allocate(Length)
665
+ buffer.writestring(SendBuffer, SendOffset, Item_3.ColorMap, Length)
666
+ end
667
+ -- Allocate 1
668
+ local OPERATION_OFFSET_2 = ARRAY_START_3
669
+ ARRAY_START_3 += 1
670
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_3.Transparency ~= nil and 1 or 0)
671
+ if Item_3.Transparency ~= nil then
672
+ -- Allocate BLOCK: 4 bytes
673
+ local BLOCK_START = Allocate(4)
674
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Transparency)
675
+ end
676
+ -- Allocate 1
677
+ local OPERATION_OFFSET_3 = ARRAY_START_3
678
+ ARRAY_START_3 += 1
679
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_3.UVOffset ~= nil and 1 or 0)
680
+ if Item_3.UVOffset ~= nil then
681
+ -- START ARRAY
682
+ -- Allocate BLOCK: 4 bytes
683
+ local ARRAY_START_5 = Allocate(4 * 2)
684
+ for Index = 1, 2 do
685
+ local Item_5 = Item_3.UVOffset[Index]
686
+ -- Allocate 4
687
+ local OPERATION_OFFSET_0 = ARRAY_START_5
688
+ ARRAY_START_5 += 4
689
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
690
+ end
691
+ -- END ARRAY
692
+ end
693
+ -- Allocate 1
694
+ local OPERATION_OFFSET_4 = ARRAY_START_3
695
+ ARRAY_START_3 += 1
696
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_3.UVScale ~= nil and 1 or 0)
697
+ if Item_3.UVScale ~= nil then
698
+ -- START ARRAY
699
+ -- Allocate BLOCK: 4 bytes
700
+ local ARRAY_START_5 = Allocate(4 * 2)
701
+ for Index = 1, 2 do
702
+ local Item_5 = Item_3.UVScale[Index]
703
+ -- Allocate 4
704
+ local OPERATION_OFFSET_0 = ARRAY_START_5
705
+ ARRAY_START_5 += 4
706
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
707
+ end
708
+ -- END ARRAY
709
+ end
710
+ -- Allocate 1
711
+ local OPERATION_OFFSET_5 = ARRAY_START_3
712
+ ARRAY_START_3 += 1
713
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_3.ZIndex ~= nil and 1 or 0)
714
+ if Item_3.ZIndex ~= nil then
715
+ -- Allocate BLOCK: 4 bytes
716
+ local BLOCK_START = Allocate(4)
717
+ buffer.writeu32(SendBuffer, BLOCK_START + 0, Item_3.ZIndex)
718
+ end
719
+ -- Allocate 1
720
+ local OPERATION_OFFSET_6 = ARRAY_START_3
721
+ ARRAY_START_3 += 1
722
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_3.Face ~= nil and 1 or 0)
723
+ if Item_3.Face ~= nil then
724
+ -- Allocate BLOCK: 1 bytes
725
+ local BLOCK_START = Allocate(1)
726
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Face)
727
+ end
728
+ end
729
+ -- END ARRAY
730
+ end
731
+ -- Allocate 2
732
+ local OPERATION_OFFSET_25 = ARRAY_START_1
733
+ ARRAY_START_1 += 2
734
+ local Elements_2 = 0
735
+ for Key_2, Element_2 in Item_1.Attributes do
736
+ Elements_2 += 1
737
+ local Length = #Key_2
738
+ local OFFSET_0 = Allocate(2)
739
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
740
+ Allocate(Length)
741
+ buffer.writestring(SendBuffer, SendOffset, Key_2, Length)
742
+ table.insert(SendInstances, if Element_2 == nil then Null else Element_2)
743
+ end
744
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_25, Elements_2)
745
+ -- START ARRAY
746
+ -- Allocate 2
747
+ local OPERATION_OFFSET_26 = ARRAY_START_1
748
+ ARRAY_START_1 += 2
749
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_26, #Item_1.Tags)
750
+ -- Allocate BLOCK: 2 bytes
751
+ local ARRAY_START_2 = Allocate(2 * #Item_1.Tags)
752
+ for Index = 1, #Item_1.Tags do
753
+ local Item_2 = Item_1.Tags[Index]
754
+ local Length = #Item_2
755
+ -- Allocate 2
756
+ local OPERATION_OFFSET_0 = ARRAY_START_2
757
+ ARRAY_START_2 += 2
758
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_0, Length)
759
+ Allocate(Length)
760
+ buffer.writestring(SendBuffer, SendOffset, Item_2, Length)
761
+ end
762
+ -- END ARRAY
763
+ end
764
+ -- END ARRAY
765
+ end
766
+
767
+ local function Shatterbox_WriteEVENT_ReplicatePuppetStates(Value1: buffer, Value2: number): ()
768
+ -- Allocate BLOCK: 5 bytes
769
+ local BLOCK_START = Allocate(5)
770
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, 0)
771
+ local Length = buffer.len(Value1)
772
+ buffer.writeu16(SendBuffer, BLOCK_START + 1, Length)
773
+ Allocate(Length)
774
+ buffer.copy(SendBuffer, SendOffset, Value1, 0, Length)
775
+ buffer.writeu16(SendBuffer, BLOCK_START + 3, Value2)
776
+ end
777
+
778
+ local function Shatterbox_WriteEVENT_DestroyPuppet(Value: number): ()
779
+ -- Allocate BLOCK: 3 bytes
780
+ local BLOCK_START = Allocate(3)
781
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, 4)
782
+ buffer.writeu16(SendBuffer, BLOCK_START + 1, Value)
783
+ end
784
+
785
+ local function Shatterbox_ReadEVENT_CreateDirtyGroupsFromClient(): ({[string]: Part})
786
+ -- Read BLOCK: 2 bytes
787
+ local BLOCK_START = Read(2)
788
+ local Value = {}
789
+ local Elements_1 = buffer.readu16(RecieveBuffer, BLOCK_START + 0)
790
+ for _ = 1, Elements_1 do
791
+ local OFFSET_0 = Read(2)
792
+ local Length = buffer.readu16(RecieveBuffer, OFFSET_0)
793
+ local Key_1 = buffer.readstring(RecieveBuffer, Read(Length), Length)
794
+ RecieveInstanceCursor += 1
795
+ local Element_1 = RecieveInstances[RecieveInstanceCursor]
796
+ if typeof(Element_1) ~= "Instance" then error(`Expected an Instance, got {typeof(Element_1)} instead.`) end
797
+ if not Element_1:IsA("Part") then error(`Expected an Instance of type "Part", got "{Element_1.ClassName}" instead.`) end
798
+ Value[Key_1] = Element_1
799
+ end
800
+ return Value
801
+ end
802
+
803
+ local function Shatterbox_WriteEVENT_CreateDirtyGroupsFromServer(Value: {[string]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}): ()
804
+ -- Allocate BLOCK: 3 bytes
805
+ local BLOCK_START = Allocate(3)
806
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, 6)
807
+ local Elements_1 = 0
808
+ for Key_1, Element_1 in Value do
809
+ Elements_1 += 1
810
+ local Length = #Key_1
811
+ local OFFSET_0 = Allocate(2)
812
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
813
+ Allocate(Length)
814
+ buffer.writestring(SendBuffer, SendOffset, Key_1, Length)
815
+ local Vector = Element_1.CFrame.Position
816
+ local OFFSET_1 = Allocate(4)
817
+ buffer.writef32(SendBuffer, OFFSET_1, Vector.X)
818
+ local OFFSET_2 = Allocate(4)
819
+ buffer.writef32(SendBuffer, OFFSET_2, Vector.Y)
820
+ local OFFSET_3 = Allocate(4)
821
+ buffer.writef32(SendBuffer, OFFSET_3, Vector.Z)
822
+ local rX, rY, rZ = Element_1.CFrame:ToOrientation()
823
+ local OFFSET_4 = Allocate(4)
824
+ buffer.writef32(SendBuffer, OFFSET_4, rX)
825
+ local OFFSET_5 = Allocate(4)
826
+ buffer.writef32(SendBuffer, OFFSET_5, rY)
827
+ local OFFSET_6 = Allocate(4)
828
+ buffer.writef32(SendBuffer, OFFSET_6, rZ)
829
+ local Vector = Element_1.Size
830
+ local OFFSET_7 = Allocate(4)
831
+ buffer.writef32(SendBuffer, OFFSET_7, Vector.X)
832
+ local OFFSET_8 = Allocate(4)
833
+ buffer.writef32(SendBuffer, OFFSET_8, Vector.Y)
834
+ local OFFSET_9 = Allocate(4)
835
+ buffer.writef32(SendBuffer, OFFSET_9, Vector.Z)
836
+ local OFFSET_10 = Allocate(1)
837
+ buffer.writeu8(SendBuffer, OFFSET_10, Element_1.Anchored and 1 or 0)
838
+ local OFFSET_11 = Allocate(1)
839
+ buffer.writeu8(SendBuffer, OFFSET_11, Element_1.Color ~= nil and 1 or 0)
840
+ if Element_1.Color ~= nil then
841
+ -- Allocate BLOCK: 3 bytes
842
+ local BLOCK_START = Allocate(3)
843
+ local Color = Element_1.Color
844
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
845
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
846
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
847
+ end
848
+ local OFFSET_12 = Allocate(1)
849
+ buffer.writeu8(SendBuffer, OFFSET_12, Element_1.Material ~= nil and 1 or 0)
850
+ if Element_1.Material ~= nil then
851
+ -- Allocate BLOCK: 2 bytes
852
+ local BLOCK_START = Allocate(2)
853
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Element_1.Material)
854
+ end
855
+ local OFFSET_13 = Allocate(1)
856
+ buffer.writeu8(SendBuffer, OFFSET_13, Element_1.Transparency ~= nil and 1 or 0)
857
+ if Element_1.Transparency ~= nil then
858
+ -- Allocate BLOCK: 2 bytes
859
+ local BLOCK_START = Allocate(2)
860
+ if Element_1.Transparency > 65504 then
861
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b0_11111_0000000000)
862
+ elseif Element_1.Transparency < -65504 then
863
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000000)
864
+ elseif Element_1.Transparency ~= Element_1.Transparency then
865
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000001)
866
+ elseif Element_1.Transparency == 0 then
867
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0)
868
+ else
869
+ local float = Element_1.Transparency
870
+ local Abosulte = math.abs(float)
871
+ local Interval = math.ldexp(1, math.floor(math.log(Abosulte, 2)) - 10)
872
+ local RoundedValue = (Abosulte // Interval) * Interval
873
+ local Fraction, Exponent = math.frexp(RoundedValue)
874
+ Exponent += 14
875
+ local Mantissa = math.round(if Exponent <= 0
876
+ then Fraction * 0x400 / math.ldexp(1, math.abs(Exponent))
877
+ else Fraction * 0x800) % 0x400
878
+ local Result = Mantissa
879
+ + math.max(Exponent, 0) * 0x400
880
+ + if float < 0 then 0x8000 else 0
881
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Result)
882
+ end
883
+ end
884
+ local OFFSET_14 = Allocate(1)
885
+ buffer.writeu8(SendBuffer, OFFSET_14, Element_1.Reflectance ~= nil and 1 or 0)
886
+ if Element_1.Reflectance ~= nil then
887
+ -- Allocate BLOCK: 2 bytes
888
+ local BLOCK_START = Allocate(2)
889
+ if Element_1.Reflectance > 65504 then
890
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b0_11111_0000000000)
891
+ elseif Element_1.Reflectance < -65504 then
892
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000000)
893
+ elseif Element_1.Reflectance ~= Element_1.Reflectance then
894
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000001)
895
+ elseif Element_1.Reflectance == 0 then
896
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0)
897
+ else
898
+ local float = Element_1.Reflectance
899
+ local Abosulte = math.abs(float)
900
+ local Interval = math.ldexp(1, math.floor(math.log(Abosulte, 2)) - 10)
901
+ local RoundedValue = (Abosulte // Interval) * Interval
902
+ local Fraction, Exponent = math.frexp(RoundedValue)
903
+ Exponent += 14
904
+ local Mantissa = math.round(if Exponent <= 0
905
+ then Fraction * 0x400 / math.ldexp(1, math.abs(Exponent))
906
+ else Fraction * 0x800) % 0x400
907
+ local Result = Mantissa
908
+ + math.max(Exponent, 0) * 0x400
909
+ + if float < 0 then 0x8000 else 0
910
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Result)
911
+ end
912
+ end
913
+ local OFFSET_15 = Allocate(1)
914
+ buffer.writeu8(SendBuffer, OFFSET_15, Element_1.MaterialVariant ~= nil and 1 or 0)
915
+ if Element_1.MaterialVariant ~= nil then
916
+ -- Allocate BLOCK: 2 bytes
917
+ local BLOCK_START = Allocate(2)
918
+ local Length = #Element_1.MaterialVariant
919
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
920
+ Allocate(Length)
921
+ buffer.writestring(SendBuffer, SendOffset, Element_1.MaterialVariant, Length)
922
+ end
923
+ local OFFSET_16 = Allocate(1)
924
+ buffer.writeu8(SendBuffer, OFFSET_16, Element_1.CollisionGroup ~= nil and 1 or 0)
925
+ if Element_1.CollisionGroup ~= nil then
926
+ -- Allocate BLOCK: 2 bytes
927
+ local BLOCK_START = Allocate(2)
928
+ local Length = #Element_1.CollisionGroup
929
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
930
+ Allocate(Length)
931
+ buffer.writestring(SendBuffer, SendOffset, Element_1.CollisionGroup, Length)
932
+ end
933
+ local OFFSET_17 = Allocate(1)
934
+ buffer.writeu8(SendBuffer, OFFSET_17, Element_1.LeftSurface ~= nil and 1 or 0)
935
+ if Element_1.LeftSurface ~= nil then
936
+ -- Allocate BLOCK: 1 bytes
937
+ local BLOCK_START = Allocate(1)
938
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.LeftSurface)
939
+ end
940
+ local OFFSET_18 = Allocate(1)
941
+ buffer.writeu8(SendBuffer, OFFSET_18, Element_1.RightSurface ~= nil and 1 or 0)
942
+ if Element_1.RightSurface ~= nil then
943
+ -- Allocate BLOCK: 1 bytes
944
+ local BLOCK_START = Allocate(1)
945
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.RightSurface)
946
+ end
947
+ local OFFSET_19 = Allocate(1)
948
+ buffer.writeu8(SendBuffer, OFFSET_19, Element_1.FrontSurface ~= nil and 1 or 0)
949
+ if Element_1.FrontSurface ~= nil then
950
+ -- Allocate BLOCK: 1 bytes
951
+ local BLOCK_START = Allocate(1)
952
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.FrontSurface)
953
+ end
954
+ local OFFSET_20 = Allocate(1)
955
+ buffer.writeu8(SendBuffer, OFFSET_20, Element_1.BackSurface ~= nil and 1 or 0)
956
+ if Element_1.BackSurface ~= nil then
957
+ -- Allocate BLOCK: 1 bytes
958
+ local BLOCK_START = Allocate(1)
959
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.BackSurface)
960
+ end
961
+ local OFFSET_21 = Allocate(1)
962
+ buffer.writeu8(SendBuffer, OFFSET_21, Element_1.TopSurface ~= nil and 1 or 0)
963
+ if Element_1.TopSurface ~= nil then
964
+ -- Allocate BLOCK: 1 bytes
965
+ local BLOCK_START = Allocate(1)
966
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.TopSurface)
967
+ end
968
+ local OFFSET_22 = Allocate(1)
969
+ buffer.writeu8(SendBuffer, OFFSET_22, Element_1.BottomSurface ~= nil and 1 or 0)
970
+ if Element_1.BottomSurface ~= nil then
971
+ -- Allocate BLOCK: 1 bytes
972
+ local BLOCK_START = Allocate(1)
973
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.BottomSurface)
974
+ end
975
+ local OFFSET_23 = Allocate(1)
976
+ buffer.writeu8(SendBuffer, OFFSET_23, Element_1.Textures ~= nil and 1 or 0)
977
+ if Element_1.Textures ~= nil then
978
+ -- Allocate BLOCK: 2 bytes
979
+ local BLOCK_START = Allocate(2)
980
+ -- START ARRAY
981
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Element_1.Textures)
982
+ -- Allocate BLOCK: 11 bytes
983
+ local ARRAY_START_3 = Allocate(11 * #Element_1.Textures)
984
+ for Index = 1, #Element_1.Textures do
985
+ local Item_3 = Element_1.Textures[Index]
986
+ -- Allocate 1
987
+ local OPERATION_OFFSET_0 = ARRAY_START_3
988
+ ARRAY_START_3 += 1
989
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_0, Item_3.Color3 ~= nil and 1 or 0)
990
+ if Item_3.Color3 ~= nil then
991
+ -- Allocate BLOCK: 3 bytes
992
+ local BLOCK_START = Allocate(3)
993
+ local Color = Item_3.Color3
994
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
995
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
996
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
997
+ end
998
+ -- Allocate 1
999
+ local OPERATION_OFFSET_1 = ARRAY_START_3
1000
+ ARRAY_START_3 += 1
1001
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_3.ColorMap ~= nil and 1 or 0)
1002
+ if Item_3.ColorMap ~= nil then
1003
+ -- Allocate BLOCK: 2 bytes
1004
+ local BLOCK_START = Allocate(2)
1005
+ local Length = #Item_3.ColorMap
1006
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
1007
+ Allocate(Length)
1008
+ buffer.writestring(SendBuffer, SendOffset, Item_3.ColorMap, Length)
1009
+ end
1010
+ -- Allocate 1
1011
+ local OPERATION_OFFSET_2 = ARRAY_START_3
1012
+ ARRAY_START_3 += 1
1013
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_3.Transparency ~= nil and 1 or 0)
1014
+ if Item_3.Transparency ~= nil then
1015
+ -- Allocate BLOCK: 4 bytes
1016
+ local BLOCK_START = Allocate(4)
1017
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Transparency)
1018
+ end
1019
+ -- Allocate 1
1020
+ local OPERATION_OFFSET_3 = ARRAY_START_3
1021
+ ARRAY_START_3 += 1
1022
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_3.UVOffset ~= nil and 1 or 0)
1023
+ if Item_3.UVOffset ~= nil then
1024
+ -- START ARRAY
1025
+ -- Allocate BLOCK: 4 bytes
1026
+ local ARRAY_START_5 = Allocate(4 * 2)
1027
+ for Index = 1, 2 do
1028
+ local Item_5 = Item_3.UVOffset[Index]
1029
+ -- Allocate 4
1030
+ local OPERATION_OFFSET_0 = ARRAY_START_5
1031
+ ARRAY_START_5 += 4
1032
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
1033
+ end
1034
+ -- END ARRAY
1035
+ end
1036
+ -- Allocate 1
1037
+ local OPERATION_OFFSET_4 = ARRAY_START_3
1038
+ ARRAY_START_3 += 1
1039
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_3.UVScale ~= nil and 1 or 0)
1040
+ if Item_3.UVScale ~= nil then
1041
+ -- START ARRAY
1042
+ -- Allocate BLOCK: 4 bytes
1043
+ local ARRAY_START_5 = Allocate(4 * 2)
1044
+ for Index = 1, 2 do
1045
+ local Item_5 = Item_3.UVScale[Index]
1046
+ -- Allocate 4
1047
+ local OPERATION_OFFSET_0 = ARRAY_START_5
1048
+ ARRAY_START_5 += 4
1049
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
1050
+ end
1051
+ -- END ARRAY
1052
+ end
1053
+ -- Allocate 1
1054
+ local OPERATION_OFFSET_5 = ARRAY_START_3
1055
+ ARRAY_START_3 += 1
1056
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_3.ZIndex ~= nil and 1 or 0)
1057
+ if Item_3.ZIndex ~= nil then
1058
+ -- Allocate BLOCK: 4 bytes
1059
+ local BLOCK_START = Allocate(4)
1060
+ buffer.writeu32(SendBuffer, BLOCK_START + 0, Item_3.ZIndex)
1061
+ end
1062
+ -- Allocate 1
1063
+ local OPERATION_OFFSET_6 = ARRAY_START_3
1064
+ ARRAY_START_3 += 1
1065
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_3.Face ~= nil and 1 or 0)
1066
+ if Item_3.Face ~= nil then
1067
+ -- Allocate BLOCK: 1 bytes
1068
+ local BLOCK_START = Allocate(1)
1069
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Face)
1070
+ end
1071
+ -- Allocate 1
1072
+ local OPERATION_OFFSET_7 = ARRAY_START_3
1073
+ ARRAY_START_3 += 1
1074
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_7, Item_3.OffsetStudsU ~= nil and 1 or 0)
1075
+ if Item_3.OffsetStudsU ~= nil then
1076
+ -- Allocate BLOCK: 4 bytes
1077
+ local BLOCK_START = Allocate(4)
1078
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.OffsetStudsU)
1079
+ end
1080
+ -- Allocate 1
1081
+ local OPERATION_OFFSET_8 = ARRAY_START_3
1082
+ ARRAY_START_3 += 1
1083
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_8, Item_3.OffsetStudsV ~= nil and 1 or 0)
1084
+ if Item_3.OffsetStudsV ~= nil then
1085
+ -- Allocate BLOCK: 4 bytes
1086
+ local BLOCK_START = Allocate(4)
1087
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.OffsetStudsV)
1088
+ end
1089
+ -- Allocate 1
1090
+ local OPERATION_OFFSET_9 = ARRAY_START_3
1091
+ ARRAY_START_3 += 1
1092
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_9, Item_3.StudsPerTileU ~= nil and 1 or 0)
1093
+ if Item_3.StudsPerTileU ~= nil then
1094
+ -- Allocate BLOCK: 4 bytes
1095
+ local BLOCK_START = Allocate(4)
1096
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.StudsPerTileU)
1097
+ end
1098
+ -- Allocate 1
1099
+ local OPERATION_OFFSET_10 = ARRAY_START_3
1100
+ ARRAY_START_3 += 1
1101
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_10, Item_3.StudsPerTileV ~= nil and 1 or 0)
1102
+ if Item_3.StudsPerTileV ~= nil then
1103
+ -- Allocate BLOCK: 4 bytes
1104
+ local BLOCK_START = Allocate(4)
1105
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.StudsPerTileV)
1106
+ end
1107
+ end
1108
+ -- END ARRAY
1109
+ end
1110
+ local OFFSET_24 = Allocate(1)
1111
+ buffer.writeu8(SendBuffer, OFFSET_24, Element_1.Lights ~= nil and 1 or 0)
1112
+ if Element_1.Lights ~= nil then
1113
+ -- Allocate BLOCK: 2 bytes
1114
+ local BLOCK_START = Allocate(2)
1115
+ -- START ARRAY
1116
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Element_1.Lights)
1117
+ -- Allocate BLOCK: 8 bytes
1118
+ local ARRAY_START_3 = Allocate(8 * #Element_1.Lights)
1119
+ for Index = 1, #Element_1.Lights do
1120
+ local Item_3 = Element_1.Lights[Index]
1121
+ local Length = #Item_3.ClassName
1122
+ -- Allocate 2
1123
+ local OPERATION_OFFSET_0 = ARRAY_START_3
1124
+ ARRAY_START_3 += 2
1125
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_0, Length)
1126
+ Allocate(Length)
1127
+ buffer.writestring(SendBuffer, SendOffset, Item_3.ClassName, Length)
1128
+ -- Allocate 1
1129
+ local OPERATION_OFFSET_1 = ARRAY_START_3
1130
+ ARRAY_START_3 += 1
1131
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_3.Brightness ~= nil and 1 or 0)
1132
+ if Item_3.Brightness ~= nil then
1133
+ -- Allocate BLOCK: 4 bytes
1134
+ local BLOCK_START = Allocate(4)
1135
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Brightness)
1136
+ end
1137
+ -- Allocate 1
1138
+ local OPERATION_OFFSET_2 = ARRAY_START_3
1139
+ ARRAY_START_3 += 1
1140
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_3.Color ~= nil and 1 or 0)
1141
+ if Item_3.Color ~= nil then
1142
+ -- Allocate BLOCK: 3 bytes
1143
+ local BLOCK_START = Allocate(3)
1144
+ local Color = Item_3.Color
1145
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
1146
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
1147
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
1148
+ end
1149
+ -- Allocate 1
1150
+ local OPERATION_OFFSET_3 = ARRAY_START_3
1151
+ ARRAY_START_3 += 1
1152
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_3.Shadows ~= nil and 1 or 0)
1153
+ if Item_3.Shadows ~= nil then
1154
+ -- Allocate BLOCK: 1 bytes
1155
+ local BLOCK_START = Allocate(1)
1156
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Shadows and 1 or 0)
1157
+ end
1158
+ -- Allocate 1
1159
+ local OPERATION_OFFSET_4 = ARRAY_START_3
1160
+ ARRAY_START_3 += 1
1161
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_3.Range ~= nil and 1 or 0)
1162
+ if Item_3.Range ~= nil then
1163
+ -- Allocate BLOCK: 4 bytes
1164
+ local BLOCK_START = Allocate(4)
1165
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Range)
1166
+ end
1167
+ -- Allocate 1
1168
+ local OPERATION_OFFSET_5 = ARRAY_START_3
1169
+ ARRAY_START_3 += 1
1170
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_3.Angle ~= nil and 1 or 0)
1171
+ if Item_3.Angle ~= nil then
1172
+ -- Allocate BLOCK: 4 bytes
1173
+ local BLOCK_START = Allocate(4)
1174
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Angle)
1175
+ end
1176
+ -- Allocate 1
1177
+ local OPERATION_OFFSET_6 = ARRAY_START_3
1178
+ ARRAY_START_3 += 1
1179
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_3.Face ~= nil and 1 or 0)
1180
+ if Item_3.Face ~= nil then
1181
+ -- Allocate BLOCK: 1 bytes
1182
+ local BLOCK_START = Allocate(1)
1183
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Face)
1184
+ end
1185
+ end
1186
+ -- END ARRAY
1187
+ end
1188
+ local OFFSET_25 = Allocate(1)
1189
+ buffer.writeu8(SendBuffer, OFFSET_25, Element_1.Decals ~= nil and 1 or 0)
1190
+ if Element_1.Decals ~= nil then
1191
+ -- Allocate BLOCK: 2 bytes
1192
+ local BLOCK_START = Allocate(2)
1193
+ -- START ARRAY
1194
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Element_1.Decals)
1195
+ -- Allocate BLOCK: 7 bytes
1196
+ local ARRAY_START_3 = Allocate(7 * #Element_1.Decals)
1197
+ for Index = 1, #Element_1.Decals do
1198
+ local Item_3 = Element_1.Decals[Index]
1199
+ -- Allocate 1
1200
+ local OPERATION_OFFSET_0 = ARRAY_START_3
1201
+ ARRAY_START_3 += 1
1202
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_0, Item_3.Color3 ~= nil and 1 or 0)
1203
+ if Item_3.Color3 ~= nil then
1204
+ -- Allocate BLOCK: 3 bytes
1205
+ local BLOCK_START = Allocate(3)
1206
+ local Color = Item_3.Color3
1207
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
1208
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
1209
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
1210
+ end
1211
+ -- Allocate 1
1212
+ local OPERATION_OFFSET_1 = ARRAY_START_3
1213
+ ARRAY_START_3 += 1
1214
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_3.ColorMap ~= nil and 1 or 0)
1215
+ if Item_3.ColorMap ~= nil then
1216
+ -- Allocate BLOCK: 2 bytes
1217
+ local BLOCK_START = Allocate(2)
1218
+ local Length = #Item_3.ColorMap
1219
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
1220
+ Allocate(Length)
1221
+ buffer.writestring(SendBuffer, SendOffset, Item_3.ColorMap, Length)
1222
+ end
1223
+ -- Allocate 1
1224
+ local OPERATION_OFFSET_2 = ARRAY_START_3
1225
+ ARRAY_START_3 += 1
1226
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_3.Transparency ~= nil and 1 or 0)
1227
+ if Item_3.Transparency ~= nil then
1228
+ -- Allocate BLOCK: 4 bytes
1229
+ local BLOCK_START = Allocate(4)
1230
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Transparency)
1231
+ end
1232
+ -- Allocate 1
1233
+ local OPERATION_OFFSET_3 = ARRAY_START_3
1234
+ ARRAY_START_3 += 1
1235
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_3.UVOffset ~= nil and 1 or 0)
1236
+ if Item_3.UVOffset ~= nil then
1237
+ -- START ARRAY
1238
+ -- Allocate BLOCK: 4 bytes
1239
+ local ARRAY_START_5 = Allocate(4 * 2)
1240
+ for Index = 1, 2 do
1241
+ local Item_5 = Item_3.UVOffset[Index]
1242
+ -- Allocate 4
1243
+ local OPERATION_OFFSET_0 = ARRAY_START_5
1244
+ ARRAY_START_5 += 4
1245
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
1246
+ end
1247
+ -- END ARRAY
1248
+ end
1249
+ -- Allocate 1
1250
+ local OPERATION_OFFSET_4 = ARRAY_START_3
1251
+ ARRAY_START_3 += 1
1252
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_3.UVScale ~= nil and 1 or 0)
1253
+ if Item_3.UVScale ~= nil then
1254
+ -- START ARRAY
1255
+ -- Allocate BLOCK: 4 bytes
1256
+ local ARRAY_START_5 = Allocate(4 * 2)
1257
+ for Index = 1, 2 do
1258
+ local Item_5 = Item_3.UVScale[Index]
1259
+ -- Allocate 4
1260
+ local OPERATION_OFFSET_0 = ARRAY_START_5
1261
+ ARRAY_START_5 += 4
1262
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
1263
+ end
1264
+ -- END ARRAY
1265
+ end
1266
+ -- Allocate 1
1267
+ local OPERATION_OFFSET_5 = ARRAY_START_3
1268
+ ARRAY_START_3 += 1
1269
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_3.ZIndex ~= nil and 1 or 0)
1270
+ if Item_3.ZIndex ~= nil then
1271
+ -- Allocate BLOCK: 4 bytes
1272
+ local BLOCK_START = Allocate(4)
1273
+ buffer.writeu32(SendBuffer, BLOCK_START + 0, Item_3.ZIndex)
1274
+ end
1275
+ -- Allocate 1
1276
+ local OPERATION_OFFSET_6 = ARRAY_START_3
1277
+ ARRAY_START_3 += 1
1278
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_3.Face ~= nil and 1 or 0)
1279
+ if Item_3.Face ~= nil then
1280
+ -- Allocate BLOCK: 1 bytes
1281
+ local BLOCK_START = Allocate(1)
1282
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Face)
1283
+ end
1284
+ end
1285
+ -- END ARRAY
1286
+ end
1287
+ local OFFSET_26 = Allocate(2)
1288
+ local Elements_2 = 0
1289
+ for Key_2, Element_2 in Element_1.Attributes do
1290
+ Elements_2 += 1
1291
+ local Length = #Key_2
1292
+ local OFFSET_0 = Allocate(2)
1293
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
1294
+ Allocate(Length)
1295
+ buffer.writestring(SendBuffer, SendOffset, Key_2, Length)
1296
+ table.insert(SendInstances, if Element_2 == nil then Null else Element_2)
1297
+ end
1298
+ buffer.writeu16(SendBuffer, OFFSET_26, Elements_2)
1299
+ -- START ARRAY
1300
+ local OFFSET_27 = Allocate(2)
1301
+ buffer.writeu16(SendBuffer, OFFSET_27, #Element_1.Tags)
1302
+ -- Allocate BLOCK: 2 bytes
1303
+ local ARRAY_START_2 = Allocate(2 * #Element_1.Tags)
1304
+ for Index = 1, #Element_1.Tags do
1305
+ local Item_2 = Element_1.Tags[Index]
1306
+ local Length = #Item_2
1307
+ -- Allocate 2
1308
+ local OPERATION_OFFSET_0 = ARRAY_START_2
1309
+ ARRAY_START_2 += 2
1310
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_0, Length)
1311
+ Allocate(Length)
1312
+ buffer.writestring(SendBuffer, SendOffset, Item_2, Length)
1313
+ end
1314
+ -- END ARRAY
1315
+ end
1316
+ buffer.writeu16(SendBuffer, BLOCK_START + 1, Elements_1)
1317
+ end
1318
+
1319
+ local function Shatterbox_WriteEVENT_ReplicateState(Value1: {[string]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}, Value2: {[string]: { { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } } }}, Value3: {[string]: boolean}, Value4: { { ID: string, CuttingPart: { CFrame: CFrame, Size: Vector3, Shape: number }, FilterTagged: { string }?, GridSize: number?, CleanupDelay: number?, SkipWalls: boolean?, SkipFloors: boolean?, SkipEncapsulatedVoxels: boolean?, OnVoxelDestruct: string?, UserData: any? } }, Value5: {[string]: number}, Value6: {[string]: {[string]: boolean}}, Value7: {[string]: number}, Value8: {[string]: number}, Value9: {[string]: number}, Value10: {[number]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}, Value11: number): ()
1320
+ -- Allocate BLOCK: 23 bytes
1321
+ local BLOCK_START = Allocate(23)
1322
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, 7)
1323
+ local Elements_1 = 0
1324
+ for Key_1, Element_1 in Value1 do
1325
+ Elements_1 += 1
1326
+ local Length = #Key_1
1327
+ local OFFSET_0 = Allocate(2)
1328
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
1329
+ Allocate(Length)
1330
+ buffer.writestring(SendBuffer, SendOffset, Key_1, Length)
1331
+ local Vector = Element_1.CFrame.Position
1332
+ local OFFSET_1 = Allocate(4)
1333
+ buffer.writef32(SendBuffer, OFFSET_1, Vector.X)
1334
+ local OFFSET_2 = Allocate(4)
1335
+ buffer.writef32(SendBuffer, OFFSET_2, Vector.Y)
1336
+ local OFFSET_3 = Allocate(4)
1337
+ buffer.writef32(SendBuffer, OFFSET_3, Vector.Z)
1338
+ local rX, rY, rZ = Element_1.CFrame:ToOrientation()
1339
+ local OFFSET_4 = Allocate(4)
1340
+ buffer.writef32(SendBuffer, OFFSET_4, rX)
1341
+ local OFFSET_5 = Allocate(4)
1342
+ buffer.writef32(SendBuffer, OFFSET_5, rY)
1343
+ local OFFSET_6 = Allocate(4)
1344
+ buffer.writef32(SendBuffer, OFFSET_6, rZ)
1345
+ local Vector = Element_1.Size
1346
+ local OFFSET_7 = Allocate(4)
1347
+ buffer.writef32(SendBuffer, OFFSET_7, Vector.X)
1348
+ local OFFSET_8 = Allocate(4)
1349
+ buffer.writef32(SendBuffer, OFFSET_8, Vector.Y)
1350
+ local OFFSET_9 = Allocate(4)
1351
+ buffer.writef32(SendBuffer, OFFSET_9, Vector.Z)
1352
+ local OFFSET_10 = Allocate(1)
1353
+ buffer.writeu8(SendBuffer, OFFSET_10, Element_1.Anchored and 1 or 0)
1354
+ local OFFSET_11 = Allocate(1)
1355
+ buffer.writeu8(SendBuffer, OFFSET_11, Element_1.Color ~= nil and 1 or 0)
1356
+ if Element_1.Color ~= nil then
1357
+ -- Allocate BLOCK: 3 bytes
1358
+ local BLOCK_START = Allocate(3)
1359
+ local Color = Element_1.Color
1360
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
1361
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
1362
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
1363
+ end
1364
+ local OFFSET_12 = Allocate(1)
1365
+ buffer.writeu8(SendBuffer, OFFSET_12, Element_1.Material ~= nil and 1 or 0)
1366
+ if Element_1.Material ~= nil then
1367
+ -- Allocate BLOCK: 2 bytes
1368
+ local BLOCK_START = Allocate(2)
1369
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Element_1.Material)
1370
+ end
1371
+ local OFFSET_13 = Allocate(1)
1372
+ buffer.writeu8(SendBuffer, OFFSET_13, Element_1.Transparency ~= nil and 1 or 0)
1373
+ if Element_1.Transparency ~= nil then
1374
+ -- Allocate BLOCK: 2 bytes
1375
+ local BLOCK_START = Allocate(2)
1376
+ if Element_1.Transparency > 65504 then
1377
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b0_11111_0000000000)
1378
+ elseif Element_1.Transparency < -65504 then
1379
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000000)
1380
+ elseif Element_1.Transparency ~= Element_1.Transparency then
1381
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000001)
1382
+ elseif Element_1.Transparency == 0 then
1383
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0)
1384
+ else
1385
+ local float = Element_1.Transparency
1386
+ local Abosulte = math.abs(float)
1387
+ local Interval = math.ldexp(1, math.floor(math.log(Abosulte, 2)) - 10)
1388
+ local RoundedValue = (Abosulte // Interval) * Interval
1389
+ local Fraction, Exponent = math.frexp(RoundedValue)
1390
+ Exponent += 14
1391
+ local Mantissa = math.round(if Exponent <= 0
1392
+ then Fraction * 0x400 / math.ldexp(1, math.abs(Exponent))
1393
+ else Fraction * 0x800) % 0x400
1394
+ local Result = Mantissa
1395
+ + math.max(Exponent, 0) * 0x400
1396
+ + if float < 0 then 0x8000 else 0
1397
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Result)
1398
+ end
1399
+ end
1400
+ local OFFSET_14 = Allocate(1)
1401
+ buffer.writeu8(SendBuffer, OFFSET_14, Element_1.Reflectance ~= nil and 1 or 0)
1402
+ if Element_1.Reflectance ~= nil then
1403
+ -- Allocate BLOCK: 2 bytes
1404
+ local BLOCK_START = Allocate(2)
1405
+ if Element_1.Reflectance > 65504 then
1406
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b0_11111_0000000000)
1407
+ elseif Element_1.Reflectance < -65504 then
1408
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000000)
1409
+ elseif Element_1.Reflectance ~= Element_1.Reflectance then
1410
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000001)
1411
+ elseif Element_1.Reflectance == 0 then
1412
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0)
1413
+ else
1414
+ local float = Element_1.Reflectance
1415
+ local Abosulte = math.abs(float)
1416
+ local Interval = math.ldexp(1, math.floor(math.log(Abosulte, 2)) - 10)
1417
+ local RoundedValue = (Abosulte // Interval) * Interval
1418
+ local Fraction, Exponent = math.frexp(RoundedValue)
1419
+ Exponent += 14
1420
+ local Mantissa = math.round(if Exponent <= 0
1421
+ then Fraction * 0x400 / math.ldexp(1, math.abs(Exponent))
1422
+ else Fraction * 0x800) % 0x400
1423
+ local Result = Mantissa
1424
+ + math.max(Exponent, 0) * 0x400
1425
+ + if float < 0 then 0x8000 else 0
1426
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Result)
1427
+ end
1428
+ end
1429
+ local OFFSET_15 = Allocate(1)
1430
+ buffer.writeu8(SendBuffer, OFFSET_15, Element_1.MaterialVariant ~= nil and 1 or 0)
1431
+ if Element_1.MaterialVariant ~= nil then
1432
+ -- Allocate BLOCK: 2 bytes
1433
+ local BLOCK_START = Allocate(2)
1434
+ local Length = #Element_1.MaterialVariant
1435
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
1436
+ Allocate(Length)
1437
+ buffer.writestring(SendBuffer, SendOffset, Element_1.MaterialVariant, Length)
1438
+ end
1439
+ local OFFSET_16 = Allocate(1)
1440
+ buffer.writeu8(SendBuffer, OFFSET_16, Element_1.CollisionGroup ~= nil and 1 or 0)
1441
+ if Element_1.CollisionGroup ~= nil then
1442
+ -- Allocate BLOCK: 2 bytes
1443
+ local BLOCK_START = Allocate(2)
1444
+ local Length = #Element_1.CollisionGroup
1445
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
1446
+ Allocate(Length)
1447
+ buffer.writestring(SendBuffer, SendOffset, Element_1.CollisionGroup, Length)
1448
+ end
1449
+ local OFFSET_17 = Allocate(1)
1450
+ buffer.writeu8(SendBuffer, OFFSET_17, Element_1.LeftSurface ~= nil and 1 or 0)
1451
+ if Element_1.LeftSurface ~= nil then
1452
+ -- Allocate BLOCK: 1 bytes
1453
+ local BLOCK_START = Allocate(1)
1454
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.LeftSurface)
1455
+ end
1456
+ local OFFSET_18 = Allocate(1)
1457
+ buffer.writeu8(SendBuffer, OFFSET_18, Element_1.RightSurface ~= nil and 1 or 0)
1458
+ if Element_1.RightSurface ~= nil then
1459
+ -- Allocate BLOCK: 1 bytes
1460
+ local BLOCK_START = Allocate(1)
1461
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.RightSurface)
1462
+ end
1463
+ local OFFSET_19 = Allocate(1)
1464
+ buffer.writeu8(SendBuffer, OFFSET_19, Element_1.FrontSurface ~= nil and 1 or 0)
1465
+ if Element_1.FrontSurface ~= nil then
1466
+ -- Allocate BLOCK: 1 bytes
1467
+ local BLOCK_START = Allocate(1)
1468
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.FrontSurface)
1469
+ end
1470
+ local OFFSET_20 = Allocate(1)
1471
+ buffer.writeu8(SendBuffer, OFFSET_20, Element_1.BackSurface ~= nil and 1 or 0)
1472
+ if Element_1.BackSurface ~= nil then
1473
+ -- Allocate BLOCK: 1 bytes
1474
+ local BLOCK_START = Allocate(1)
1475
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.BackSurface)
1476
+ end
1477
+ local OFFSET_21 = Allocate(1)
1478
+ buffer.writeu8(SendBuffer, OFFSET_21, Element_1.TopSurface ~= nil and 1 or 0)
1479
+ if Element_1.TopSurface ~= nil then
1480
+ -- Allocate BLOCK: 1 bytes
1481
+ local BLOCK_START = Allocate(1)
1482
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.TopSurface)
1483
+ end
1484
+ local OFFSET_22 = Allocate(1)
1485
+ buffer.writeu8(SendBuffer, OFFSET_22, Element_1.BottomSurface ~= nil and 1 or 0)
1486
+ if Element_1.BottomSurface ~= nil then
1487
+ -- Allocate BLOCK: 1 bytes
1488
+ local BLOCK_START = Allocate(1)
1489
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.BottomSurface)
1490
+ end
1491
+ local OFFSET_23 = Allocate(1)
1492
+ buffer.writeu8(SendBuffer, OFFSET_23, Element_1.Textures ~= nil and 1 or 0)
1493
+ if Element_1.Textures ~= nil then
1494
+ -- Allocate BLOCK: 2 bytes
1495
+ local BLOCK_START = Allocate(2)
1496
+ -- START ARRAY
1497
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Element_1.Textures)
1498
+ -- Allocate BLOCK: 11 bytes
1499
+ local ARRAY_START_3 = Allocate(11 * #Element_1.Textures)
1500
+ for Index = 1, #Element_1.Textures do
1501
+ local Item_3 = Element_1.Textures[Index]
1502
+ -- Allocate 1
1503
+ local OPERATION_OFFSET_0 = ARRAY_START_3
1504
+ ARRAY_START_3 += 1
1505
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_0, Item_3.Color3 ~= nil and 1 or 0)
1506
+ if Item_3.Color3 ~= nil then
1507
+ -- Allocate BLOCK: 3 bytes
1508
+ local BLOCK_START = Allocate(3)
1509
+ local Color = Item_3.Color3
1510
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
1511
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
1512
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
1513
+ end
1514
+ -- Allocate 1
1515
+ local OPERATION_OFFSET_1 = ARRAY_START_3
1516
+ ARRAY_START_3 += 1
1517
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_3.ColorMap ~= nil and 1 or 0)
1518
+ if Item_3.ColorMap ~= nil then
1519
+ -- Allocate BLOCK: 2 bytes
1520
+ local BLOCK_START = Allocate(2)
1521
+ local Length = #Item_3.ColorMap
1522
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
1523
+ Allocate(Length)
1524
+ buffer.writestring(SendBuffer, SendOffset, Item_3.ColorMap, Length)
1525
+ end
1526
+ -- Allocate 1
1527
+ local OPERATION_OFFSET_2 = ARRAY_START_3
1528
+ ARRAY_START_3 += 1
1529
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_3.Transparency ~= nil and 1 or 0)
1530
+ if Item_3.Transparency ~= nil then
1531
+ -- Allocate BLOCK: 4 bytes
1532
+ local BLOCK_START = Allocate(4)
1533
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Transparency)
1534
+ end
1535
+ -- Allocate 1
1536
+ local OPERATION_OFFSET_3 = ARRAY_START_3
1537
+ ARRAY_START_3 += 1
1538
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_3.UVOffset ~= nil and 1 or 0)
1539
+ if Item_3.UVOffset ~= nil then
1540
+ -- START ARRAY
1541
+ -- Allocate BLOCK: 4 bytes
1542
+ local ARRAY_START_5 = Allocate(4 * 2)
1543
+ for Index = 1, 2 do
1544
+ local Item_5 = Item_3.UVOffset[Index]
1545
+ -- Allocate 4
1546
+ local OPERATION_OFFSET_0 = ARRAY_START_5
1547
+ ARRAY_START_5 += 4
1548
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
1549
+ end
1550
+ -- END ARRAY
1551
+ end
1552
+ -- Allocate 1
1553
+ local OPERATION_OFFSET_4 = ARRAY_START_3
1554
+ ARRAY_START_3 += 1
1555
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_3.UVScale ~= nil and 1 or 0)
1556
+ if Item_3.UVScale ~= nil then
1557
+ -- START ARRAY
1558
+ -- Allocate BLOCK: 4 bytes
1559
+ local ARRAY_START_5 = Allocate(4 * 2)
1560
+ for Index = 1, 2 do
1561
+ local Item_5 = Item_3.UVScale[Index]
1562
+ -- Allocate 4
1563
+ local OPERATION_OFFSET_0 = ARRAY_START_5
1564
+ ARRAY_START_5 += 4
1565
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
1566
+ end
1567
+ -- END ARRAY
1568
+ end
1569
+ -- Allocate 1
1570
+ local OPERATION_OFFSET_5 = ARRAY_START_3
1571
+ ARRAY_START_3 += 1
1572
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_3.ZIndex ~= nil and 1 or 0)
1573
+ if Item_3.ZIndex ~= nil then
1574
+ -- Allocate BLOCK: 4 bytes
1575
+ local BLOCK_START = Allocate(4)
1576
+ buffer.writeu32(SendBuffer, BLOCK_START + 0, Item_3.ZIndex)
1577
+ end
1578
+ -- Allocate 1
1579
+ local OPERATION_OFFSET_6 = ARRAY_START_3
1580
+ ARRAY_START_3 += 1
1581
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_3.Face ~= nil and 1 or 0)
1582
+ if Item_3.Face ~= nil then
1583
+ -- Allocate BLOCK: 1 bytes
1584
+ local BLOCK_START = Allocate(1)
1585
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Face)
1586
+ end
1587
+ -- Allocate 1
1588
+ local OPERATION_OFFSET_7 = ARRAY_START_3
1589
+ ARRAY_START_3 += 1
1590
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_7, Item_3.OffsetStudsU ~= nil and 1 or 0)
1591
+ if Item_3.OffsetStudsU ~= nil then
1592
+ -- Allocate BLOCK: 4 bytes
1593
+ local BLOCK_START = Allocate(4)
1594
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.OffsetStudsU)
1595
+ end
1596
+ -- Allocate 1
1597
+ local OPERATION_OFFSET_8 = ARRAY_START_3
1598
+ ARRAY_START_3 += 1
1599
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_8, Item_3.OffsetStudsV ~= nil and 1 or 0)
1600
+ if Item_3.OffsetStudsV ~= nil then
1601
+ -- Allocate BLOCK: 4 bytes
1602
+ local BLOCK_START = Allocate(4)
1603
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.OffsetStudsV)
1604
+ end
1605
+ -- Allocate 1
1606
+ local OPERATION_OFFSET_9 = ARRAY_START_3
1607
+ ARRAY_START_3 += 1
1608
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_9, Item_3.StudsPerTileU ~= nil and 1 or 0)
1609
+ if Item_3.StudsPerTileU ~= nil then
1610
+ -- Allocate BLOCK: 4 bytes
1611
+ local BLOCK_START = Allocate(4)
1612
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.StudsPerTileU)
1613
+ end
1614
+ -- Allocate 1
1615
+ local OPERATION_OFFSET_10 = ARRAY_START_3
1616
+ ARRAY_START_3 += 1
1617
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_10, Item_3.StudsPerTileV ~= nil and 1 or 0)
1618
+ if Item_3.StudsPerTileV ~= nil then
1619
+ -- Allocate BLOCK: 4 bytes
1620
+ local BLOCK_START = Allocate(4)
1621
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.StudsPerTileV)
1622
+ end
1623
+ end
1624
+ -- END ARRAY
1625
+ end
1626
+ local OFFSET_24 = Allocate(1)
1627
+ buffer.writeu8(SendBuffer, OFFSET_24, Element_1.Lights ~= nil and 1 or 0)
1628
+ if Element_1.Lights ~= nil then
1629
+ -- Allocate BLOCK: 2 bytes
1630
+ local BLOCK_START = Allocate(2)
1631
+ -- START ARRAY
1632
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Element_1.Lights)
1633
+ -- Allocate BLOCK: 8 bytes
1634
+ local ARRAY_START_3 = Allocate(8 * #Element_1.Lights)
1635
+ for Index = 1, #Element_1.Lights do
1636
+ local Item_3 = Element_1.Lights[Index]
1637
+ local Length = #Item_3.ClassName
1638
+ -- Allocate 2
1639
+ local OPERATION_OFFSET_0 = ARRAY_START_3
1640
+ ARRAY_START_3 += 2
1641
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_0, Length)
1642
+ Allocate(Length)
1643
+ buffer.writestring(SendBuffer, SendOffset, Item_3.ClassName, Length)
1644
+ -- Allocate 1
1645
+ local OPERATION_OFFSET_1 = ARRAY_START_3
1646
+ ARRAY_START_3 += 1
1647
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_3.Brightness ~= nil and 1 or 0)
1648
+ if Item_3.Brightness ~= nil then
1649
+ -- Allocate BLOCK: 4 bytes
1650
+ local BLOCK_START = Allocate(4)
1651
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Brightness)
1652
+ end
1653
+ -- Allocate 1
1654
+ local OPERATION_OFFSET_2 = ARRAY_START_3
1655
+ ARRAY_START_3 += 1
1656
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_3.Color ~= nil and 1 or 0)
1657
+ if Item_3.Color ~= nil then
1658
+ -- Allocate BLOCK: 3 bytes
1659
+ local BLOCK_START = Allocate(3)
1660
+ local Color = Item_3.Color
1661
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
1662
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
1663
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
1664
+ end
1665
+ -- Allocate 1
1666
+ local OPERATION_OFFSET_3 = ARRAY_START_3
1667
+ ARRAY_START_3 += 1
1668
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_3.Shadows ~= nil and 1 or 0)
1669
+ if Item_3.Shadows ~= nil then
1670
+ -- Allocate BLOCK: 1 bytes
1671
+ local BLOCK_START = Allocate(1)
1672
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Shadows and 1 or 0)
1673
+ end
1674
+ -- Allocate 1
1675
+ local OPERATION_OFFSET_4 = ARRAY_START_3
1676
+ ARRAY_START_3 += 1
1677
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_3.Range ~= nil and 1 or 0)
1678
+ if Item_3.Range ~= nil then
1679
+ -- Allocate BLOCK: 4 bytes
1680
+ local BLOCK_START = Allocate(4)
1681
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Range)
1682
+ end
1683
+ -- Allocate 1
1684
+ local OPERATION_OFFSET_5 = ARRAY_START_3
1685
+ ARRAY_START_3 += 1
1686
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_3.Angle ~= nil and 1 or 0)
1687
+ if Item_3.Angle ~= nil then
1688
+ -- Allocate BLOCK: 4 bytes
1689
+ local BLOCK_START = Allocate(4)
1690
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Angle)
1691
+ end
1692
+ -- Allocate 1
1693
+ local OPERATION_OFFSET_6 = ARRAY_START_3
1694
+ ARRAY_START_3 += 1
1695
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_3.Face ~= nil and 1 or 0)
1696
+ if Item_3.Face ~= nil then
1697
+ -- Allocate BLOCK: 1 bytes
1698
+ local BLOCK_START = Allocate(1)
1699
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Face)
1700
+ end
1701
+ end
1702
+ -- END ARRAY
1703
+ end
1704
+ local OFFSET_25 = Allocate(1)
1705
+ buffer.writeu8(SendBuffer, OFFSET_25, Element_1.Decals ~= nil and 1 or 0)
1706
+ if Element_1.Decals ~= nil then
1707
+ -- Allocate BLOCK: 2 bytes
1708
+ local BLOCK_START = Allocate(2)
1709
+ -- START ARRAY
1710
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Element_1.Decals)
1711
+ -- Allocate BLOCK: 7 bytes
1712
+ local ARRAY_START_3 = Allocate(7 * #Element_1.Decals)
1713
+ for Index = 1, #Element_1.Decals do
1714
+ local Item_3 = Element_1.Decals[Index]
1715
+ -- Allocate 1
1716
+ local OPERATION_OFFSET_0 = ARRAY_START_3
1717
+ ARRAY_START_3 += 1
1718
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_0, Item_3.Color3 ~= nil and 1 or 0)
1719
+ if Item_3.Color3 ~= nil then
1720
+ -- Allocate BLOCK: 3 bytes
1721
+ local BLOCK_START = Allocate(3)
1722
+ local Color = Item_3.Color3
1723
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
1724
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
1725
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
1726
+ end
1727
+ -- Allocate 1
1728
+ local OPERATION_OFFSET_1 = ARRAY_START_3
1729
+ ARRAY_START_3 += 1
1730
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_3.ColorMap ~= nil and 1 or 0)
1731
+ if Item_3.ColorMap ~= nil then
1732
+ -- Allocate BLOCK: 2 bytes
1733
+ local BLOCK_START = Allocate(2)
1734
+ local Length = #Item_3.ColorMap
1735
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
1736
+ Allocate(Length)
1737
+ buffer.writestring(SendBuffer, SendOffset, Item_3.ColorMap, Length)
1738
+ end
1739
+ -- Allocate 1
1740
+ local OPERATION_OFFSET_2 = ARRAY_START_3
1741
+ ARRAY_START_3 += 1
1742
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_3.Transparency ~= nil and 1 or 0)
1743
+ if Item_3.Transparency ~= nil then
1744
+ -- Allocate BLOCK: 4 bytes
1745
+ local BLOCK_START = Allocate(4)
1746
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Transparency)
1747
+ end
1748
+ -- Allocate 1
1749
+ local OPERATION_OFFSET_3 = ARRAY_START_3
1750
+ ARRAY_START_3 += 1
1751
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_3.UVOffset ~= nil and 1 or 0)
1752
+ if Item_3.UVOffset ~= nil then
1753
+ -- START ARRAY
1754
+ -- Allocate BLOCK: 4 bytes
1755
+ local ARRAY_START_5 = Allocate(4 * 2)
1756
+ for Index = 1, 2 do
1757
+ local Item_5 = Item_3.UVOffset[Index]
1758
+ -- Allocate 4
1759
+ local OPERATION_OFFSET_0 = ARRAY_START_5
1760
+ ARRAY_START_5 += 4
1761
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
1762
+ end
1763
+ -- END ARRAY
1764
+ end
1765
+ -- Allocate 1
1766
+ local OPERATION_OFFSET_4 = ARRAY_START_3
1767
+ ARRAY_START_3 += 1
1768
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_3.UVScale ~= nil and 1 or 0)
1769
+ if Item_3.UVScale ~= nil then
1770
+ -- START ARRAY
1771
+ -- Allocate BLOCK: 4 bytes
1772
+ local ARRAY_START_5 = Allocate(4 * 2)
1773
+ for Index = 1, 2 do
1774
+ local Item_5 = Item_3.UVScale[Index]
1775
+ -- Allocate 4
1776
+ local OPERATION_OFFSET_0 = ARRAY_START_5
1777
+ ARRAY_START_5 += 4
1778
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
1779
+ end
1780
+ -- END ARRAY
1781
+ end
1782
+ -- Allocate 1
1783
+ local OPERATION_OFFSET_5 = ARRAY_START_3
1784
+ ARRAY_START_3 += 1
1785
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_3.ZIndex ~= nil and 1 or 0)
1786
+ if Item_3.ZIndex ~= nil then
1787
+ -- Allocate BLOCK: 4 bytes
1788
+ local BLOCK_START = Allocate(4)
1789
+ buffer.writeu32(SendBuffer, BLOCK_START + 0, Item_3.ZIndex)
1790
+ end
1791
+ -- Allocate 1
1792
+ local OPERATION_OFFSET_6 = ARRAY_START_3
1793
+ ARRAY_START_3 += 1
1794
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_3.Face ~= nil and 1 or 0)
1795
+ if Item_3.Face ~= nil then
1796
+ -- Allocate BLOCK: 1 bytes
1797
+ local BLOCK_START = Allocate(1)
1798
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Face)
1799
+ end
1800
+ end
1801
+ -- END ARRAY
1802
+ end
1803
+ local OFFSET_26 = Allocate(2)
1804
+ local Elements_2 = 0
1805
+ for Key_2, Element_2 in Element_1.Attributes do
1806
+ Elements_2 += 1
1807
+ local Length = #Key_2
1808
+ local OFFSET_0 = Allocate(2)
1809
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
1810
+ Allocate(Length)
1811
+ buffer.writestring(SendBuffer, SendOffset, Key_2, Length)
1812
+ table.insert(SendInstances, if Element_2 == nil then Null else Element_2)
1813
+ end
1814
+ buffer.writeu16(SendBuffer, OFFSET_26, Elements_2)
1815
+ -- START ARRAY
1816
+ local OFFSET_27 = Allocate(2)
1817
+ buffer.writeu16(SendBuffer, OFFSET_27, #Element_1.Tags)
1818
+ -- Allocate BLOCK: 2 bytes
1819
+ local ARRAY_START_2 = Allocate(2 * #Element_1.Tags)
1820
+ for Index = 1, #Element_1.Tags do
1821
+ local Item_2 = Element_1.Tags[Index]
1822
+ local Length = #Item_2
1823
+ -- Allocate 2
1824
+ local OPERATION_OFFSET_0 = ARRAY_START_2
1825
+ ARRAY_START_2 += 2
1826
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_0, Length)
1827
+ Allocate(Length)
1828
+ buffer.writestring(SendBuffer, SendOffset, Item_2, Length)
1829
+ end
1830
+ -- END ARRAY
1831
+ end
1832
+ buffer.writeu16(SendBuffer, BLOCK_START + 1, Elements_1)
1833
+ local Elements_1 = 0
1834
+ for Key_1, Element_1 in Value2 do
1835
+ Elements_1 += 1
1836
+ local Length = #Key_1
1837
+ local OFFSET_0 = Allocate(2)
1838
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
1839
+ Allocate(Length)
1840
+ buffer.writestring(SendBuffer, SendOffset, Key_1, Length)
1841
+ -- START ARRAY
1842
+ local OFFSET_1 = Allocate(2)
1843
+ buffer.writeu16(SendBuffer, OFFSET_1, #Element_1)
1844
+ -- Allocate BLOCK: 56 bytes
1845
+ local ARRAY_START_2 = Allocate(56 * #Element_1)
1846
+ for Index = 1, #Element_1 do
1847
+ local Item_2 = Element_1[Index]
1848
+ local Vector = Item_2.CFrame.Position
1849
+ -- Allocate 4
1850
+ local OPERATION_OFFSET_0 = ARRAY_START_2
1851
+ ARRAY_START_2 += 4
1852
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Vector.X)
1853
+ -- Allocate 4
1854
+ local OPERATION_OFFSET_1 = ARRAY_START_2
1855
+ ARRAY_START_2 += 4
1856
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_1, Vector.Y)
1857
+ -- Allocate 4
1858
+ local OPERATION_OFFSET_2 = ARRAY_START_2
1859
+ ARRAY_START_2 += 4
1860
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_2, Vector.Z)
1861
+ local rX, rY, rZ = Item_2.CFrame:ToOrientation()
1862
+ -- Allocate 4
1863
+ local OPERATION_OFFSET_3 = ARRAY_START_2
1864
+ ARRAY_START_2 += 4
1865
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_3, rX)
1866
+ -- Allocate 4
1867
+ local OPERATION_OFFSET_4 = ARRAY_START_2
1868
+ ARRAY_START_2 += 4
1869
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_4, rY)
1870
+ -- Allocate 4
1871
+ local OPERATION_OFFSET_5 = ARRAY_START_2
1872
+ ARRAY_START_2 += 4
1873
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_5, rZ)
1874
+ local Vector = Item_2.Size
1875
+ -- Allocate 4
1876
+ local OPERATION_OFFSET_6 = ARRAY_START_2
1877
+ ARRAY_START_2 += 4
1878
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_6, Vector.X)
1879
+ -- Allocate 4
1880
+ local OPERATION_OFFSET_7 = ARRAY_START_2
1881
+ ARRAY_START_2 += 4
1882
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_7, Vector.Y)
1883
+ -- Allocate 4
1884
+ local OPERATION_OFFSET_8 = ARRAY_START_2
1885
+ ARRAY_START_2 += 4
1886
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_8, Vector.Z)
1887
+ -- Allocate 1
1888
+ local OPERATION_OFFSET_9 = ARRAY_START_2
1889
+ ARRAY_START_2 += 1
1890
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_9, Item_2.Anchored and 1 or 0)
1891
+ -- Allocate 1
1892
+ local OPERATION_OFFSET_10 = ARRAY_START_2
1893
+ ARRAY_START_2 += 1
1894
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_10, Item_2.Color ~= nil and 1 or 0)
1895
+ if Item_2.Color ~= nil then
1896
+ -- Allocate BLOCK: 3 bytes
1897
+ local BLOCK_START = Allocate(3)
1898
+ local Color = Item_2.Color
1899
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
1900
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
1901
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
1902
+ end
1903
+ -- Allocate 1
1904
+ local OPERATION_OFFSET_11 = ARRAY_START_2
1905
+ ARRAY_START_2 += 1
1906
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_11, Item_2.Material ~= nil and 1 or 0)
1907
+ if Item_2.Material ~= nil then
1908
+ -- Allocate BLOCK: 2 bytes
1909
+ local BLOCK_START = Allocate(2)
1910
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Item_2.Material)
1911
+ end
1912
+ -- Allocate 1
1913
+ local OPERATION_OFFSET_12 = ARRAY_START_2
1914
+ ARRAY_START_2 += 1
1915
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_12, Item_2.Transparency ~= nil and 1 or 0)
1916
+ if Item_2.Transparency ~= nil then
1917
+ -- Allocate BLOCK: 2 bytes
1918
+ local BLOCK_START = Allocate(2)
1919
+ if Item_2.Transparency > 65504 then
1920
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b0_11111_0000000000)
1921
+ elseif Item_2.Transparency < -65504 then
1922
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000000)
1923
+ elseif Item_2.Transparency ~= Item_2.Transparency then
1924
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000001)
1925
+ elseif Item_2.Transparency == 0 then
1926
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0)
1927
+ else
1928
+ local float = Item_2.Transparency
1929
+ local Abosulte = math.abs(float)
1930
+ local Interval = math.ldexp(1, math.floor(math.log(Abosulte, 2)) - 10)
1931
+ local RoundedValue = (Abosulte // Interval) * Interval
1932
+ local Fraction, Exponent = math.frexp(RoundedValue)
1933
+ Exponent += 14
1934
+ local Mantissa = math.round(if Exponent <= 0
1935
+ then Fraction * 0x400 / math.ldexp(1, math.abs(Exponent))
1936
+ else Fraction * 0x800) % 0x400
1937
+ local Result = Mantissa
1938
+ + math.max(Exponent, 0) * 0x400
1939
+ + if float < 0 then 0x8000 else 0
1940
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Result)
1941
+ end
1942
+ end
1943
+ -- Allocate 1
1944
+ local OPERATION_OFFSET_13 = ARRAY_START_2
1945
+ ARRAY_START_2 += 1
1946
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_13, Item_2.Reflectance ~= nil and 1 or 0)
1947
+ if Item_2.Reflectance ~= nil then
1948
+ -- Allocate BLOCK: 2 bytes
1949
+ local BLOCK_START = Allocate(2)
1950
+ if Item_2.Reflectance > 65504 then
1951
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b0_11111_0000000000)
1952
+ elseif Item_2.Reflectance < -65504 then
1953
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000000)
1954
+ elseif Item_2.Reflectance ~= Item_2.Reflectance then
1955
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000001)
1956
+ elseif Item_2.Reflectance == 0 then
1957
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0)
1958
+ else
1959
+ local float = Item_2.Reflectance
1960
+ local Abosulte = math.abs(float)
1961
+ local Interval = math.ldexp(1, math.floor(math.log(Abosulte, 2)) - 10)
1962
+ local RoundedValue = (Abosulte // Interval) * Interval
1963
+ local Fraction, Exponent = math.frexp(RoundedValue)
1964
+ Exponent += 14
1965
+ local Mantissa = math.round(if Exponent <= 0
1966
+ then Fraction * 0x400 / math.ldexp(1, math.abs(Exponent))
1967
+ else Fraction * 0x800) % 0x400
1968
+ local Result = Mantissa
1969
+ + math.max(Exponent, 0) * 0x400
1970
+ + if float < 0 then 0x8000 else 0
1971
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Result)
1972
+ end
1973
+ end
1974
+ -- Allocate 1
1975
+ local OPERATION_OFFSET_14 = ARRAY_START_2
1976
+ ARRAY_START_2 += 1
1977
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_14, Item_2.MaterialVariant ~= nil and 1 or 0)
1978
+ if Item_2.MaterialVariant ~= nil then
1979
+ -- Allocate BLOCK: 2 bytes
1980
+ local BLOCK_START = Allocate(2)
1981
+ local Length = #Item_2.MaterialVariant
1982
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
1983
+ Allocate(Length)
1984
+ buffer.writestring(SendBuffer, SendOffset, Item_2.MaterialVariant, Length)
1985
+ end
1986
+ -- Allocate 1
1987
+ local OPERATION_OFFSET_15 = ARRAY_START_2
1988
+ ARRAY_START_2 += 1
1989
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_15, Item_2.CollisionGroup ~= nil and 1 or 0)
1990
+ if Item_2.CollisionGroup ~= nil then
1991
+ -- Allocate BLOCK: 2 bytes
1992
+ local BLOCK_START = Allocate(2)
1993
+ local Length = #Item_2.CollisionGroup
1994
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
1995
+ Allocate(Length)
1996
+ buffer.writestring(SendBuffer, SendOffset, Item_2.CollisionGroup, Length)
1997
+ end
1998
+ -- Allocate 1
1999
+ local OPERATION_OFFSET_16 = ARRAY_START_2
2000
+ ARRAY_START_2 += 1
2001
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_16, Item_2.LeftSurface ~= nil and 1 or 0)
2002
+ if Item_2.LeftSurface ~= nil then
2003
+ -- Allocate BLOCK: 1 bytes
2004
+ local BLOCK_START = Allocate(1)
2005
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_2.LeftSurface)
2006
+ end
2007
+ -- Allocate 1
2008
+ local OPERATION_OFFSET_17 = ARRAY_START_2
2009
+ ARRAY_START_2 += 1
2010
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_17, Item_2.RightSurface ~= nil and 1 or 0)
2011
+ if Item_2.RightSurface ~= nil then
2012
+ -- Allocate BLOCK: 1 bytes
2013
+ local BLOCK_START = Allocate(1)
2014
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_2.RightSurface)
2015
+ end
2016
+ -- Allocate 1
2017
+ local OPERATION_OFFSET_18 = ARRAY_START_2
2018
+ ARRAY_START_2 += 1
2019
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_18, Item_2.FrontSurface ~= nil and 1 or 0)
2020
+ if Item_2.FrontSurface ~= nil then
2021
+ -- Allocate BLOCK: 1 bytes
2022
+ local BLOCK_START = Allocate(1)
2023
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_2.FrontSurface)
2024
+ end
2025
+ -- Allocate 1
2026
+ local OPERATION_OFFSET_19 = ARRAY_START_2
2027
+ ARRAY_START_2 += 1
2028
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_19, Item_2.BackSurface ~= nil and 1 or 0)
2029
+ if Item_2.BackSurface ~= nil then
2030
+ -- Allocate BLOCK: 1 bytes
2031
+ local BLOCK_START = Allocate(1)
2032
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_2.BackSurface)
2033
+ end
2034
+ -- Allocate 1
2035
+ local OPERATION_OFFSET_20 = ARRAY_START_2
2036
+ ARRAY_START_2 += 1
2037
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_20, Item_2.TopSurface ~= nil and 1 or 0)
2038
+ if Item_2.TopSurface ~= nil then
2039
+ -- Allocate BLOCK: 1 bytes
2040
+ local BLOCK_START = Allocate(1)
2041
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_2.TopSurface)
2042
+ end
2043
+ -- Allocate 1
2044
+ local OPERATION_OFFSET_21 = ARRAY_START_2
2045
+ ARRAY_START_2 += 1
2046
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_21, Item_2.BottomSurface ~= nil and 1 or 0)
2047
+ if Item_2.BottomSurface ~= nil then
2048
+ -- Allocate BLOCK: 1 bytes
2049
+ local BLOCK_START = Allocate(1)
2050
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_2.BottomSurface)
2051
+ end
2052
+ -- Allocate 1
2053
+ local OPERATION_OFFSET_22 = ARRAY_START_2
2054
+ ARRAY_START_2 += 1
2055
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_22, Item_2.Textures ~= nil and 1 or 0)
2056
+ if Item_2.Textures ~= nil then
2057
+ -- Allocate BLOCK: 2 bytes
2058
+ local BLOCK_START = Allocate(2)
2059
+ -- START ARRAY
2060
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Item_2.Textures)
2061
+ -- Allocate BLOCK: 11 bytes
2062
+ local ARRAY_START_4 = Allocate(11 * #Item_2.Textures)
2063
+ for Index = 1, #Item_2.Textures do
2064
+ local Item_4 = Item_2.Textures[Index]
2065
+ -- Allocate 1
2066
+ local OPERATION_OFFSET_0 = ARRAY_START_4
2067
+ ARRAY_START_4 += 1
2068
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_0, Item_4.Color3 ~= nil and 1 or 0)
2069
+ if Item_4.Color3 ~= nil then
2070
+ -- Allocate BLOCK: 3 bytes
2071
+ local BLOCK_START = Allocate(3)
2072
+ local Color = Item_4.Color3
2073
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
2074
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
2075
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
2076
+ end
2077
+ -- Allocate 1
2078
+ local OPERATION_OFFSET_1 = ARRAY_START_4
2079
+ ARRAY_START_4 += 1
2080
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_4.ColorMap ~= nil and 1 or 0)
2081
+ if Item_4.ColorMap ~= nil then
2082
+ -- Allocate BLOCK: 2 bytes
2083
+ local BLOCK_START = Allocate(2)
2084
+ local Length = #Item_4.ColorMap
2085
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
2086
+ Allocate(Length)
2087
+ buffer.writestring(SendBuffer, SendOffset, Item_4.ColorMap, Length)
2088
+ end
2089
+ -- Allocate 1
2090
+ local OPERATION_OFFSET_2 = ARRAY_START_4
2091
+ ARRAY_START_4 += 1
2092
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_4.Transparency ~= nil and 1 or 0)
2093
+ if Item_4.Transparency ~= nil then
2094
+ -- Allocate BLOCK: 4 bytes
2095
+ local BLOCK_START = Allocate(4)
2096
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_4.Transparency)
2097
+ end
2098
+ -- Allocate 1
2099
+ local OPERATION_OFFSET_3 = ARRAY_START_4
2100
+ ARRAY_START_4 += 1
2101
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_4.UVOffset ~= nil and 1 or 0)
2102
+ if Item_4.UVOffset ~= nil then
2103
+ -- START ARRAY
2104
+ -- Allocate BLOCK: 4 bytes
2105
+ local ARRAY_START_6 = Allocate(4 * 2)
2106
+ for Index = 1, 2 do
2107
+ local Item_6 = Item_4.UVOffset[Index]
2108
+ -- Allocate 4
2109
+ local OPERATION_OFFSET_0 = ARRAY_START_6
2110
+ ARRAY_START_6 += 4
2111
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_6)
2112
+ end
2113
+ -- END ARRAY
2114
+ end
2115
+ -- Allocate 1
2116
+ local OPERATION_OFFSET_4 = ARRAY_START_4
2117
+ ARRAY_START_4 += 1
2118
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_4.UVScale ~= nil and 1 or 0)
2119
+ if Item_4.UVScale ~= nil then
2120
+ -- START ARRAY
2121
+ -- Allocate BLOCK: 4 bytes
2122
+ local ARRAY_START_6 = Allocate(4 * 2)
2123
+ for Index = 1, 2 do
2124
+ local Item_6 = Item_4.UVScale[Index]
2125
+ -- Allocate 4
2126
+ local OPERATION_OFFSET_0 = ARRAY_START_6
2127
+ ARRAY_START_6 += 4
2128
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_6)
2129
+ end
2130
+ -- END ARRAY
2131
+ end
2132
+ -- Allocate 1
2133
+ local OPERATION_OFFSET_5 = ARRAY_START_4
2134
+ ARRAY_START_4 += 1
2135
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_4.ZIndex ~= nil and 1 or 0)
2136
+ if Item_4.ZIndex ~= nil then
2137
+ -- Allocate BLOCK: 4 bytes
2138
+ local BLOCK_START = Allocate(4)
2139
+ buffer.writeu32(SendBuffer, BLOCK_START + 0, Item_4.ZIndex)
2140
+ end
2141
+ -- Allocate 1
2142
+ local OPERATION_OFFSET_6 = ARRAY_START_4
2143
+ ARRAY_START_4 += 1
2144
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_4.Face ~= nil and 1 or 0)
2145
+ if Item_4.Face ~= nil then
2146
+ -- Allocate BLOCK: 1 bytes
2147
+ local BLOCK_START = Allocate(1)
2148
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_4.Face)
2149
+ end
2150
+ -- Allocate 1
2151
+ local OPERATION_OFFSET_7 = ARRAY_START_4
2152
+ ARRAY_START_4 += 1
2153
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_7, Item_4.OffsetStudsU ~= nil and 1 or 0)
2154
+ if Item_4.OffsetStudsU ~= nil then
2155
+ -- Allocate BLOCK: 4 bytes
2156
+ local BLOCK_START = Allocate(4)
2157
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_4.OffsetStudsU)
2158
+ end
2159
+ -- Allocate 1
2160
+ local OPERATION_OFFSET_8 = ARRAY_START_4
2161
+ ARRAY_START_4 += 1
2162
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_8, Item_4.OffsetStudsV ~= nil and 1 or 0)
2163
+ if Item_4.OffsetStudsV ~= nil then
2164
+ -- Allocate BLOCK: 4 bytes
2165
+ local BLOCK_START = Allocate(4)
2166
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_4.OffsetStudsV)
2167
+ end
2168
+ -- Allocate 1
2169
+ local OPERATION_OFFSET_9 = ARRAY_START_4
2170
+ ARRAY_START_4 += 1
2171
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_9, Item_4.StudsPerTileU ~= nil and 1 or 0)
2172
+ if Item_4.StudsPerTileU ~= nil then
2173
+ -- Allocate BLOCK: 4 bytes
2174
+ local BLOCK_START = Allocate(4)
2175
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_4.StudsPerTileU)
2176
+ end
2177
+ -- Allocate 1
2178
+ local OPERATION_OFFSET_10 = ARRAY_START_4
2179
+ ARRAY_START_4 += 1
2180
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_10, Item_4.StudsPerTileV ~= nil and 1 or 0)
2181
+ if Item_4.StudsPerTileV ~= nil then
2182
+ -- Allocate BLOCK: 4 bytes
2183
+ local BLOCK_START = Allocate(4)
2184
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_4.StudsPerTileV)
2185
+ end
2186
+ end
2187
+ -- END ARRAY
2188
+ end
2189
+ -- Allocate 1
2190
+ local OPERATION_OFFSET_23 = ARRAY_START_2
2191
+ ARRAY_START_2 += 1
2192
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_23, Item_2.Lights ~= nil and 1 or 0)
2193
+ if Item_2.Lights ~= nil then
2194
+ -- Allocate BLOCK: 2 bytes
2195
+ local BLOCK_START = Allocate(2)
2196
+ -- START ARRAY
2197
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Item_2.Lights)
2198
+ -- Allocate BLOCK: 8 bytes
2199
+ local ARRAY_START_4 = Allocate(8 * #Item_2.Lights)
2200
+ for Index = 1, #Item_2.Lights do
2201
+ local Item_4 = Item_2.Lights[Index]
2202
+ local Length = #Item_4.ClassName
2203
+ -- Allocate 2
2204
+ local OPERATION_OFFSET_0 = ARRAY_START_4
2205
+ ARRAY_START_4 += 2
2206
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_0, Length)
2207
+ Allocate(Length)
2208
+ buffer.writestring(SendBuffer, SendOffset, Item_4.ClassName, Length)
2209
+ -- Allocate 1
2210
+ local OPERATION_OFFSET_1 = ARRAY_START_4
2211
+ ARRAY_START_4 += 1
2212
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_4.Brightness ~= nil and 1 or 0)
2213
+ if Item_4.Brightness ~= nil then
2214
+ -- Allocate BLOCK: 4 bytes
2215
+ local BLOCK_START = Allocate(4)
2216
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_4.Brightness)
2217
+ end
2218
+ -- Allocate 1
2219
+ local OPERATION_OFFSET_2 = ARRAY_START_4
2220
+ ARRAY_START_4 += 1
2221
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_4.Color ~= nil and 1 or 0)
2222
+ if Item_4.Color ~= nil then
2223
+ -- Allocate BLOCK: 3 bytes
2224
+ local BLOCK_START = Allocate(3)
2225
+ local Color = Item_4.Color
2226
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
2227
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
2228
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
2229
+ end
2230
+ -- Allocate 1
2231
+ local OPERATION_OFFSET_3 = ARRAY_START_4
2232
+ ARRAY_START_4 += 1
2233
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_4.Shadows ~= nil and 1 or 0)
2234
+ if Item_4.Shadows ~= nil then
2235
+ -- Allocate BLOCK: 1 bytes
2236
+ local BLOCK_START = Allocate(1)
2237
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_4.Shadows and 1 or 0)
2238
+ end
2239
+ -- Allocate 1
2240
+ local OPERATION_OFFSET_4 = ARRAY_START_4
2241
+ ARRAY_START_4 += 1
2242
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_4.Range ~= nil and 1 or 0)
2243
+ if Item_4.Range ~= nil then
2244
+ -- Allocate BLOCK: 4 bytes
2245
+ local BLOCK_START = Allocate(4)
2246
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_4.Range)
2247
+ end
2248
+ -- Allocate 1
2249
+ local OPERATION_OFFSET_5 = ARRAY_START_4
2250
+ ARRAY_START_4 += 1
2251
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_4.Angle ~= nil and 1 or 0)
2252
+ if Item_4.Angle ~= nil then
2253
+ -- Allocate BLOCK: 4 bytes
2254
+ local BLOCK_START = Allocate(4)
2255
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_4.Angle)
2256
+ end
2257
+ -- Allocate 1
2258
+ local OPERATION_OFFSET_6 = ARRAY_START_4
2259
+ ARRAY_START_4 += 1
2260
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_4.Face ~= nil and 1 or 0)
2261
+ if Item_4.Face ~= nil then
2262
+ -- Allocate BLOCK: 1 bytes
2263
+ local BLOCK_START = Allocate(1)
2264
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_4.Face)
2265
+ end
2266
+ end
2267
+ -- END ARRAY
2268
+ end
2269
+ -- Allocate 1
2270
+ local OPERATION_OFFSET_24 = ARRAY_START_2
2271
+ ARRAY_START_2 += 1
2272
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_24, Item_2.Decals ~= nil and 1 or 0)
2273
+ if Item_2.Decals ~= nil then
2274
+ -- Allocate BLOCK: 2 bytes
2275
+ local BLOCK_START = Allocate(2)
2276
+ -- START ARRAY
2277
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Item_2.Decals)
2278
+ -- Allocate BLOCK: 7 bytes
2279
+ local ARRAY_START_4 = Allocate(7 * #Item_2.Decals)
2280
+ for Index = 1, #Item_2.Decals do
2281
+ local Item_4 = Item_2.Decals[Index]
2282
+ -- Allocate 1
2283
+ local OPERATION_OFFSET_0 = ARRAY_START_4
2284
+ ARRAY_START_4 += 1
2285
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_0, Item_4.Color3 ~= nil and 1 or 0)
2286
+ if Item_4.Color3 ~= nil then
2287
+ -- Allocate BLOCK: 3 bytes
2288
+ local BLOCK_START = Allocate(3)
2289
+ local Color = Item_4.Color3
2290
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
2291
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
2292
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
2293
+ end
2294
+ -- Allocate 1
2295
+ local OPERATION_OFFSET_1 = ARRAY_START_4
2296
+ ARRAY_START_4 += 1
2297
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_4.ColorMap ~= nil and 1 or 0)
2298
+ if Item_4.ColorMap ~= nil then
2299
+ -- Allocate BLOCK: 2 bytes
2300
+ local BLOCK_START = Allocate(2)
2301
+ local Length = #Item_4.ColorMap
2302
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
2303
+ Allocate(Length)
2304
+ buffer.writestring(SendBuffer, SendOffset, Item_4.ColorMap, Length)
2305
+ end
2306
+ -- Allocate 1
2307
+ local OPERATION_OFFSET_2 = ARRAY_START_4
2308
+ ARRAY_START_4 += 1
2309
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_4.Transparency ~= nil and 1 or 0)
2310
+ if Item_4.Transparency ~= nil then
2311
+ -- Allocate BLOCK: 4 bytes
2312
+ local BLOCK_START = Allocate(4)
2313
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_4.Transparency)
2314
+ end
2315
+ -- Allocate 1
2316
+ local OPERATION_OFFSET_3 = ARRAY_START_4
2317
+ ARRAY_START_4 += 1
2318
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_4.UVOffset ~= nil and 1 or 0)
2319
+ if Item_4.UVOffset ~= nil then
2320
+ -- START ARRAY
2321
+ -- Allocate BLOCK: 4 bytes
2322
+ local ARRAY_START_6 = Allocate(4 * 2)
2323
+ for Index = 1, 2 do
2324
+ local Item_6 = Item_4.UVOffset[Index]
2325
+ -- Allocate 4
2326
+ local OPERATION_OFFSET_0 = ARRAY_START_6
2327
+ ARRAY_START_6 += 4
2328
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_6)
2329
+ end
2330
+ -- END ARRAY
2331
+ end
2332
+ -- Allocate 1
2333
+ local OPERATION_OFFSET_4 = ARRAY_START_4
2334
+ ARRAY_START_4 += 1
2335
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_4.UVScale ~= nil and 1 or 0)
2336
+ if Item_4.UVScale ~= nil then
2337
+ -- START ARRAY
2338
+ -- Allocate BLOCK: 4 bytes
2339
+ local ARRAY_START_6 = Allocate(4 * 2)
2340
+ for Index = 1, 2 do
2341
+ local Item_6 = Item_4.UVScale[Index]
2342
+ -- Allocate 4
2343
+ local OPERATION_OFFSET_0 = ARRAY_START_6
2344
+ ARRAY_START_6 += 4
2345
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_6)
2346
+ end
2347
+ -- END ARRAY
2348
+ end
2349
+ -- Allocate 1
2350
+ local OPERATION_OFFSET_5 = ARRAY_START_4
2351
+ ARRAY_START_4 += 1
2352
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_4.ZIndex ~= nil and 1 or 0)
2353
+ if Item_4.ZIndex ~= nil then
2354
+ -- Allocate BLOCK: 4 bytes
2355
+ local BLOCK_START = Allocate(4)
2356
+ buffer.writeu32(SendBuffer, BLOCK_START + 0, Item_4.ZIndex)
2357
+ end
2358
+ -- Allocate 1
2359
+ local OPERATION_OFFSET_6 = ARRAY_START_4
2360
+ ARRAY_START_4 += 1
2361
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_4.Face ~= nil and 1 or 0)
2362
+ if Item_4.Face ~= nil then
2363
+ -- Allocate BLOCK: 1 bytes
2364
+ local BLOCK_START = Allocate(1)
2365
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_4.Face)
2366
+ end
2367
+ end
2368
+ -- END ARRAY
2369
+ end
2370
+ -- Allocate 2
2371
+ local OPERATION_OFFSET_25 = ARRAY_START_2
2372
+ ARRAY_START_2 += 2
2373
+ local Elements_3 = 0
2374
+ for Key_3, Element_3 in Item_2.Attributes do
2375
+ Elements_3 += 1
2376
+ local Length = #Key_3
2377
+ local OFFSET_0 = Allocate(2)
2378
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
2379
+ Allocate(Length)
2380
+ buffer.writestring(SendBuffer, SendOffset, Key_3, Length)
2381
+ table.insert(SendInstances, if Element_3 == nil then Null else Element_3)
2382
+ end
2383
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_25, Elements_3)
2384
+ -- START ARRAY
2385
+ -- Allocate 2
2386
+ local OPERATION_OFFSET_26 = ARRAY_START_2
2387
+ ARRAY_START_2 += 2
2388
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_26, #Item_2.Tags)
2389
+ -- Allocate BLOCK: 2 bytes
2390
+ local ARRAY_START_3 = Allocate(2 * #Item_2.Tags)
2391
+ for Index = 1, #Item_2.Tags do
2392
+ local Item_3 = Item_2.Tags[Index]
2393
+ local Length = #Item_3
2394
+ -- Allocate 2
2395
+ local OPERATION_OFFSET_0 = ARRAY_START_3
2396
+ ARRAY_START_3 += 2
2397
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_0, Length)
2398
+ Allocate(Length)
2399
+ buffer.writestring(SendBuffer, SendOffset, Item_3, Length)
2400
+ end
2401
+ -- END ARRAY
2402
+ end
2403
+ -- END ARRAY
2404
+ end
2405
+ buffer.writeu16(SendBuffer, BLOCK_START + 3, Elements_1)
2406
+ local Elements_1 = 0
2407
+ for Key_1, Element_1 in Value3 do
2408
+ Elements_1 += 1
2409
+ local Length = #Key_1
2410
+ local OFFSET_0 = Allocate(2)
2411
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
2412
+ Allocate(Length)
2413
+ buffer.writestring(SendBuffer, SendOffset, Key_1, Length)
2414
+ local OFFSET_1 = Allocate(1)
2415
+ buffer.writeu8(SendBuffer, OFFSET_1, Element_1 and 1 or 0)
2416
+ end
2417
+ buffer.writeu16(SendBuffer, BLOCK_START + 5, Elements_1)
2418
+ -- START ARRAY
2419
+ buffer.writeu16(SendBuffer, BLOCK_START + 7, #Value4)
2420
+ -- Allocate BLOCK: 47 bytes
2421
+ local ARRAY_START_1 = Allocate(47 * #Value4)
2422
+ for Index = 1, #Value4 do
2423
+ local Item_1 = Value4[Index]
2424
+ local Length = #Item_1.ID
2425
+ -- Allocate 2
2426
+ local OPERATION_OFFSET_0 = ARRAY_START_1
2427
+ ARRAY_START_1 += 2
2428
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_0, Length)
2429
+ Allocate(Length)
2430
+ buffer.writestring(SendBuffer, SendOffset, Item_1.ID, Length)
2431
+ local Vector = Item_1.CuttingPart.CFrame.Position
2432
+ -- Allocate 4
2433
+ local OPERATION_OFFSET_1 = ARRAY_START_1
2434
+ ARRAY_START_1 += 4
2435
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_1, Vector.X)
2436
+ -- Allocate 4
2437
+ local OPERATION_OFFSET_2 = ARRAY_START_1
2438
+ ARRAY_START_1 += 4
2439
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_2, Vector.Y)
2440
+ -- Allocate 4
2441
+ local OPERATION_OFFSET_3 = ARRAY_START_1
2442
+ ARRAY_START_1 += 4
2443
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_3, Vector.Z)
2444
+ local rX, rY, rZ = Item_1.CuttingPart.CFrame:ToOrientation()
2445
+ -- Allocate 4
2446
+ local OPERATION_OFFSET_4 = ARRAY_START_1
2447
+ ARRAY_START_1 += 4
2448
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_4, rX)
2449
+ -- Allocate 4
2450
+ local OPERATION_OFFSET_5 = ARRAY_START_1
2451
+ ARRAY_START_1 += 4
2452
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_5, rY)
2453
+ -- Allocate 4
2454
+ local OPERATION_OFFSET_6 = ARRAY_START_1
2455
+ ARRAY_START_1 += 4
2456
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_6, rZ)
2457
+ local Vector = Item_1.CuttingPart.Size
2458
+ -- Allocate 4
2459
+ local OPERATION_OFFSET_7 = ARRAY_START_1
2460
+ ARRAY_START_1 += 4
2461
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_7, Vector.X)
2462
+ -- Allocate 4
2463
+ local OPERATION_OFFSET_8 = ARRAY_START_1
2464
+ ARRAY_START_1 += 4
2465
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_8, Vector.Y)
2466
+ -- Allocate 4
2467
+ local OPERATION_OFFSET_9 = ARRAY_START_1
2468
+ ARRAY_START_1 += 4
2469
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_9, Vector.Z)
2470
+ -- Allocate 1
2471
+ local OPERATION_OFFSET_10 = ARRAY_START_1
2472
+ ARRAY_START_1 += 1
2473
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_10, Item_1.CuttingPart.Shape)
2474
+ -- Allocate 1
2475
+ local OPERATION_OFFSET_11 = ARRAY_START_1
2476
+ ARRAY_START_1 += 1
2477
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_11, Item_1.FilterTagged ~= nil and 1 or 0)
2478
+ if Item_1.FilterTagged ~= nil then
2479
+ -- Allocate BLOCK: 2 bytes
2480
+ local BLOCK_START = Allocate(2)
2481
+ -- START ARRAY
2482
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Item_1.FilterTagged)
2483
+ -- Allocate BLOCK: 2 bytes
2484
+ local ARRAY_START_3 = Allocate(2 * #Item_1.FilterTagged)
2485
+ for Index = 1, #Item_1.FilterTagged do
2486
+ local Item_3 = Item_1.FilterTagged[Index]
2487
+ local Length = #Item_3
2488
+ -- Allocate 2
2489
+ local OPERATION_OFFSET_0 = ARRAY_START_3
2490
+ ARRAY_START_3 += 2
2491
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_0, Length)
2492
+ Allocate(Length)
2493
+ buffer.writestring(SendBuffer, SendOffset, Item_3, Length)
2494
+ end
2495
+ -- END ARRAY
2496
+ end
2497
+ -- Allocate 1
2498
+ local OPERATION_OFFSET_12 = ARRAY_START_1
2499
+ ARRAY_START_1 += 1
2500
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_12, Item_1.GridSize ~= nil and 1 or 0)
2501
+ if Item_1.GridSize ~= nil then
2502
+ -- Allocate BLOCK: 4 bytes
2503
+ local BLOCK_START = Allocate(4)
2504
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_1.GridSize)
2505
+ end
2506
+ -- Allocate 1
2507
+ local OPERATION_OFFSET_13 = ARRAY_START_1
2508
+ ARRAY_START_1 += 1
2509
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_13, Item_1.CleanupDelay ~= nil and 1 or 0)
2510
+ if Item_1.CleanupDelay ~= nil then
2511
+ -- Allocate BLOCK: 4 bytes
2512
+ local BLOCK_START = Allocate(4)
2513
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_1.CleanupDelay)
2514
+ end
2515
+ -- Allocate 1
2516
+ local OPERATION_OFFSET_14 = ARRAY_START_1
2517
+ ARRAY_START_1 += 1
2518
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_14, Item_1.SkipWalls ~= nil and 1 or 0)
2519
+ if Item_1.SkipWalls ~= nil then
2520
+ -- Allocate BLOCK: 1 bytes
2521
+ local BLOCK_START = Allocate(1)
2522
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_1.SkipWalls and 1 or 0)
2523
+ end
2524
+ -- Allocate 1
2525
+ local OPERATION_OFFSET_15 = ARRAY_START_1
2526
+ ARRAY_START_1 += 1
2527
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_15, Item_1.SkipFloors ~= nil and 1 or 0)
2528
+ if Item_1.SkipFloors ~= nil then
2529
+ -- Allocate BLOCK: 1 bytes
2530
+ local BLOCK_START = Allocate(1)
2531
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_1.SkipFloors and 1 or 0)
2532
+ end
2533
+ -- Allocate 1
2534
+ local OPERATION_OFFSET_16 = ARRAY_START_1
2535
+ ARRAY_START_1 += 1
2536
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_16, Item_1.SkipEncapsulatedVoxels ~= nil and 1 or 0)
2537
+ if Item_1.SkipEncapsulatedVoxels ~= nil then
2538
+ -- Allocate BLOCK: 1 bytes
2539
+ local BLOCK_START = Allocate(1)
2540
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_1.SkipEncapsulatedVoxels and 1 or 0)
2541
+ end
2542
+ -- Allocate 1
2543
+ local OPERATION_OFFSET_17 = ARRAY_START_1
2544
+ ARRAY_START_1 += 1
2545
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_17, Item_1.OnVoxelDestruct ~= nil and 1 or 0)
2546
+ if Item_1.OnVoxelDestruct ~= nil then
2547
+ -- Allocate BLOCK: 2 bytes
2548
+ local BLOCK_START = Allocate(2)
2549
+ local Length = #Item_1.OnVoxelDestruct
2550
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
2551
+ Allocate(Length)
2552
+ buffer.writestring(SendBuffer, SendOffset, Item_1.OnVoxelDestruct, Length)
2553
+ end
2554
+ -- Allocate 1
2555
+ local OPERATION_OFFSET_18 = ARRAY_START_1
2556
+ ARRAY_START_1 += 1
2557
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_18, Item_1.UserData ~= nil and 1 or 0)
2558
+ if Item_1.UserData ~= nil then
2559
+ table.insert(SendInstances, if Item_1.UserData == nil then Null else Item_1.UserData)
2560
+ end
2561
+ end
2562
+ -- END ARRAY
2563
+ local Elements_1 = 0
2564
+ for Key_1, Element_1 in Value5 do
2565
+ Elements_1 += 1
2566
+ local Length = #Key_1
2567
+ local OFFSET_0 = Allocate(2)
2568
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
2569
+ Allocate(Length)
2570
+ buffer.writestring(SendBuffer, SendOffset, Key_1, Length)
2571
+ local OFFSET_1 = Allocate(4)
2572
+ buffer.writeu32(SendBuffer, OFFSET_1, Element_1)
2573
+ end
2574
+ buffer.writeu16(SendBuffer, BLOCK_START + 9, Elements_1)
2575
+ local Elements_1 = 0
2576
+ for Key_1, Element_1 in Value6 do
2577
+ Elements_1 += 1
2578
+ local Length = #Key_1
2579
+ local OFFSET_0 = Allocate(2)
2580
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
2581
+ Allocate(Length)
2582
+ buffer.writestring(SendBuffer, SendOffset, Key_1, Length)
2583
+ local OFFSET_1 = Allocate(2)
2584
+ local Elements_2 = 0
2585
+ for Key_2, Element_2 in Element_1 do
2586
+ Elements_2 += 1
2587
+ local Length = #Key_2
2588
+ local OFFSET_0 = Allocate(2)
2589
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
2590
+ Allocate(Length)
2591
+ buffer.writestring(SendBuffer, SendOffset, Key_2, Length)
2592
+ local OFFSET_1 = Allocate(1)
2593
+ buffer.writeu8(SendBuffer, OFFSET_1, Element_2 and 1 or 0)
2594
+ end
2595
+ buffer.writeu16(SendBuffer, OFFSET_1, Elements_2)
2596
+ end
2597
+ buffer.writeu16(SendBuffer, BLOCK_START + 11, Elements_1)
2598
+ local Elements_1 = 0
2599
+ for Key_1, Element_1 in Value7 do
2600
+ Elements_1 += 1
2601
+ local Length = #Key_1
2602
+ local OFFSET_0 = Allocate(2)
2603
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
2604
+ Allocate(Length)
2605
+ buffer.writestring(SendBuffer, SendOffset, Key_1, Length)
2606
+ local OFFSET_1 = Allocate(4)
2607
+ buffer.writef32(SendBuffer, OFFSET_1, Element_1)
2608
+ end
2609
+ buffer.writeu16(SendBuffer, BLOCK_START + 13, Elements_1)
2610
+ local Elements_1 = 0
2611
+ for Key_1, Element_1 in Value8 do
2612
+ Elements_1 += 1
2613
+ local Length = #Key_1
2614
+ local OFFSET_0 = Allocate(2)
2615
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
2616
+ Allocate(Length)
2617
+ buffer.writestring(SendBuffer, SendOffset, Key_1, Length)
2618
+ local OFFSET_1 = Allocate(4)
2619
+ buffer.writef32(SendBuffer, OFFSET_1, Element_1)
2620
+ end
2621
+ buffer.writeu16(SendBuffer, BLOCK_START + 15, Elements_1)
2622
+ local Elements_1 = 0
2623
+ for Key_1, Element_1 in Value9 do
2624
+ Elements_1 += 1
2625
+ local Length = #Key_1
2626
+ local OFFSET_0 = Allocate(2)
2627
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
2628
+ Allocate(Length)
2629
+ buffer.writestring(SendBuffer, SendOffset, Key_1, Length)
2630
+ local OFFSET_1 = Allocate(4)
2631
+ buffer.writef32(SendBuffer, OFFSET_1, Element_1)
2632
+ end
2633
+ buffer.writeu16(SendBuffer, BLOCK_START + 17, Elements_1)
2634
+ local Elements_1 = 0
2635
+ for Key_1, Element_1 in Value10 do
2636
+ Elements_1 += 1
2637
+ local OFFSET_0 = Allocate(2)
2638
+ buffer.writeu16(SendBuffer, OFFSET_0, Key_1)
2639
+ local Vector = Element_1.CFrame.Position
2640
+ local OFFSET_1 = Allocate(4)
2641
+ buffer.writef32(SendBuffer, OFFSET_1, Vector.X)
2642
+ local OFFSET_2 = Allocate(4)
2643
+ buffer.writef32(SendBuffer, OFFSET_2, Vector.Y)
2644
+ local OFFSET_3 = Allocate(4)
2645
+ buffer.writef32(SendBuffer, OFFSET_3, Vector.Z)
2646
+ local rX, rY, rZ = Element_1.CFrame:ToOrientation()
2647
+ local OFFSET_4 = Allocate(4)
2648
+ buffer.writef32(SendBuffer, OFFSET_4, rX)
2649
+ local OFFSET_5 = Allocate(4)
2650
+ buffer.writef32(SendBuffer, OFFSET_5, rY)
2651
+ local OFFSET_6 = Allocate(4)
2652
+ buffer.writef32(SendBuffer, OFFSET_6, rZ)
2653
+ local Vector = Element_1.Size
2654
+ local OFFSET_7 = Allocate(4)
2655
+ buffer.writef32(SendBuffer, OFFSET_7, Vector.X)
2656
+ local OFFSET_8 = Allocate(4)
2657
+ buffer.writef32(SendBuffer, OFFSET_8, Vector.Y)
2658
+ local OFFSET_9 = Allocate(4)
2659
+ buffer.writef32(SendBuffer, OFFSET_9, Vector.Z)
2660
+ local OFFSET_10 = Allocate(1)
2661
+ buffer.writeu8(SendBuffer, OFFSET_10, Element_1.Anchored and 1 or 0)
2662
+ local OFFSET_11 = Allocate(1)
2663
+ buffer.writeu8(SendBuffer, OFFSET_11, Element_1.Color ~= nil and 1 or 0)
2664
+ if Element_1.Color ~= nil then
2665
+ -- Allocate BLOCK: 3 bytes
2666
+ local BLOCK_START = Allocate(3)
2667
+ local Color = Element_1.Color
2668
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
2669
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
2670
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
2671
+ end
2672
+ local OFFSET_12 = Allocate(1)
2673
+ buffer.writeu8(SendBuffer, OFFSET_12, Element_1.Material ~= nil and 1 or 0)
2674
+ if Element_1.Material ~= nil then
2675
+ -- Allocate BLOCK: 2 bytes
2676
+ local BLOCK_START = Allocate(2)
2677
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Element_1.Material)
2678
+ end
2679
+ local OFFSET_13 = Allocate(1)
2680
+ buffer.writeu8(SendBuffer, OFFSET_13, Element_1.Transparency ~= nil and 1 or 0)
2681
+ if Element_1.Transparency ~= nil then
2682
+ -- Allocate BLOCK: 2 bytes
2683
+ local BLOCK_START = Allocate(2)
2684
+ if Element_1.Transparency > 65504 then
2685
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b0_11111_0000000000)
2686
+ elseif Element_1.Transparency < -65504 then
2687
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000000)
2688
+ elseif Element_1.Transparency ~= Element_1.Transparency then
2689
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000001)
2690
+ elseif Element_1.Transparency == 0 then
2691
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0)
2692
+ else
2693
+ local float = Element_1.Transparency
2694
+ local Abosulte = math.abs(float)
2695
+ local Interval = math.ldexp(1, math.floor(math.log(Abosulte, 2)) - 10)
2696
+ local RoundedValue = (Abosulte // Interval) * Interval
2697
+ local Fraction, Exponent = math.frexp(RoundedValue)
2698
+ Exponent += 14
2699
+ local Mantissa = math.round(if Exponent <= 0
2700
+ then Fraction * 0x400 / math.ldexp(1, math.abs(Exponent))
2701
+ else Fraction * 0x800) % 0x400
2702
+ local Result = Mantissa
2703
+ + math.max(Exponent, 0) * 0x400
2704
+ + if float < 0 then 0x8000 else 0
2705
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Result)
2706
+ end
2707
+ end
2708
+ local OFFSET_14 = Allocate(1)
2709
+ buffer.writeu8(SendBuffer, OFFSET_14, Element_1.Reflectance ~= nil and 1 or 0)
2710
+ if Element_1.Reflectance ~= nil then
2711
+ -- Allocate BLOCK: 2 bytes
2712
+ local BLOCK_START = Allocate(2)
2713
+ if Element_1.Reflectance > 65504 then
2714
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b0_11111_0000000000)
2715
+ elseif Element_1.Reflectance < -65504 then
2716
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000000)
2717
+ elseif Element_1.Reflectance ~= Element_1.Reflectance then
2718
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000001)
2719
+ elseif Element_1.Reflectance == 0 then
2720
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0)
2721
+ else
2722
+ local float = Element_1.Reflectance
2723
+ local Abosulte = math.abs(float)
2724
+ local Interval = math.ldexp(1, math.floor(math.log(Abosulte, 2)) - 10)
2725
+ local RoundedValue = (Abosulte // Interval) * Interval
2726
+ local Fraction, Exponent = math.frexp(RoundedValue)
2727
+ Exponent += 14
2728
+ local Mantissa = math.round(if Exponent <= 0
2729
+ then Fraction * 0x400 / math.ldexp(1, math.abs(Exponent))
2730
+ else Fraction * 0x800) % 0x400
2731
+ local Result = Mantissa
2732
+ + math.max(Exponent, 0) * 0x400
2733
+ + if float < 0 then 0x8000 else 0
2734
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Result)
2735
+ end
2736
+ end
2737
+ local OFFSET_15 = Allocate(1)
2738
+ buffer.writeu8(SendBuffer, OFFSET_15, Element_1.MaterialVariant ~= nil and 1 or 0)
2739
+ if Element_1.MaterialVariant ~= nil then
2740
+ -- Allocate BLOCK: 2 bytes
2741
+ local BLOCK_START = Allocate(2)
2742
+ local Length = #Element_1.MaterialVariant
2743
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
2744
+ Allocate(Length)
2745
+ buffer.writestring(SendBuffer, SendOffset, Element_1.MaterialVariant, Length)
2746
+ end
2747
+ local OFFSET_16 = Allocate(1)
2748
+ buffer.writeu8(SendBuffer, OFFSET_16, Element_1.CollisionGroup ~= nil and 1 or 0)
2749
+ if Element_1.CollisionGroup ~= nil then
2750
+ -- Allocate BLOCK: 2 bytes
2751
+ local BLOCK_START = Allocate(2)
2752
+ local Length = #Element_1.CollisionGroup
2753
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
2754
+ Allocate(Length)
2755
+ buffer.writestring(SendBuffer, SendOffset, Element_1.CollisionGroup, Length)
2756
+ end
2757
+ local OFFSET_17 = Allocate(1)
2758
+ buffer.writeu8(SendBuffer, OFFSET_17, Element_1.LeftSurface ~= nil and 1 or 0)
2759
+ if Element_1.LeftSurface ~= nil then
2760
+ -- Allocate BLOCK: 1 bytes
2761
+ local BLOCK_START = Allocate(1)
2762
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.LeftSurface)
2763
+ end
2764
+ local OFFSET_18 = Allocate(1)
2765
+ buffer.writeu8(SendBuffer, OFFSET_18, Element_1.RightSurface ~= nil and 1 or 0)
2766
+ if Element_1.RightSurface ~= nil then
2767
+ -- Allocate BLOCK: 1 bytes
2768
+ local BLOCK_START = Allocate(1)
2769
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.RightSurface)
2770
+ end
2771
+ local OFFSET_19 = Allocate(1)
2772
+ buffer.writeu8(SendBuffer, OFFSET_19, Element_1.FrontSurface ~= nil and 1 or 0)
2773
+ if Element_1.FrontSurface ~= nil then
2774
+ -- Allocate BLOCK: 1 bytes
2775
+ local BLOCK_START = Allocate(1)
2776
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.FrontSurface)
2777
+ end
2778
+ local OFFSET_20 = Allocate(1)
2779
+ buffer.writeu8(SendBuffer, OFFSET_20, Element_1.BackSurface ~= nil and 1 or 0)
2780
+ if Element_1.BackSurface ~= nil then
2781
+ -- Allocate BLOCK: 1 bytes
2782
+ local BLOCK_START = Allocate(1)
2783
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.BackSurface)
2784
+ end
2785
+ local OFFSET_21 = Allocate(1)
2786
+ buffer.writeu8(SendBuffer, OFFSET_21, Element_1.TopSurface ~= nil and 1 or 0)
2787
+ if Element_1.TopSurface ~= nil then
2788
+ -- Allocate BLOCK: 1 bytes
2789
+ local BLOCK_START = Allocate(1)
2790
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.TopSurface)
2791
+ end
2792
+ local OFFSET_22 = Allocate(1)
2793
+ buffer.writeu8(SendBuffer, OFFSET_22, Element_1.BottomSurface ~= nil and 1 or 0)
2794
+ if Element_1.BottomSurface ~= nil then
2795
+ -- Allocate BLOCK: 1 bytes
2796
+ local BLOCK_START = Allocate(1)
2797
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.BottomSurface)
2798
+ end
2799
+ local OFFSET_23 = Allocate(1)
2800
+ buffer.writeu8(SendBuffer, OFFSET_23, Element_1.Textures ~= nil and 1 or 0)
2801
+ if Element_1.Textures ~= nil then
2802
+ -- Allocate BLOCK: 2 bytes
2803
+ local BLOCK_START = Allocate(2)
2804
+ -- START ARRAY
2805
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Element_1.Textures)
2806
+ -- Allocate BLOCK: 11 bytes
2807
+ local ARRAY_START_3 = Allocate(11 * #Element_1.Textures)
2808
+ for Index = 1, #Element_1.Textures do
2809
+ local Item_3 = Element_1.Textures[Index]
2810
+ -- Allocate 1
2811
+ local OPERATION_OFFSET_0 = ARRAY_START_3
2812
+ ARRAY_START_3 += 1
2813
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_0, Item_3.Color3 ~= nil and 1 or 0)
2814
+ if Item_3.Color3 ~= nil then
2815
+ -- Allocate BLOCK: 3 bytes
2816
+ local BLOCK_START = Allocate(3)
2817
+ local Color = Item_3.Color3
2818
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
2819
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
2820
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
2821
+ end
2822
+ -- Allocate 1
2823
+ local OPERATION_OFFSET_1 = ARRAY_START_3
2824
+ ARRAY_START_3 += 1
2825
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_3.ColorMap ~= nil and 1 or 0)
2826
+ if Item_3.ColorMap ~= nil then
2827
+ -- Allocate BLOCK: 2 bytes
2828
+ local BLOCK_START = Allocate(2)
2829
+ local Length = #Item_3.ColorMap
2830
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
2831
+ Allocate(Length)
2832
+ buffer.writestring(SendBuffer, SendOffset, Item_3.ColorMap, Length)
2833
+ end
2834
+ -- Allocate 1
2835
+ local OPERATION_OFFSET_2 = ARRAY_START_3
2836
+ ARRAY_START_3 += 1
2837
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_3.Transparency ~= nil and 1 or 0)
2838
+ if Item_3.Transparency ~= nil then
2839
+ -- Allocate BLOCK: 4 bytes
2840
+ local BLOCK_START = Allocate(4)
2841
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Transparency)
2842
+ end
2843
+ -- Allocate 1
2844
+ local OPERATION_OFFSET_3 = ARRAY_START_3
2845
+ ARRAY_START_3 += 1
2846
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_3.UVOffset ~= nil and 1 or 0)
2847
+ if Item_3.UVOffset ~= nil then
2848
+ -- START ARRAY
2849
+ -- Allocate BLOCK: 4 bytes
2850
+ local ARRAY_START_5 = Allocate(4 * 2)
2851
+ for Index = 1, 2 do
2852
+ local Item_5 = Item_3.UVOffset[Index]
2853
+ -- Allocate 4
2854
+ local OPERATION_OFFSET_0 = ARRAY_START_5
2855
+ ARRAY_START_5 += 4
2856
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
2857
+ end
2858
+ -- END ARRAY
2859
+ end
2860
+ -- Allocate 1
2861
+ local OPERATION_OFFSET_4 = ARRAY_START_3
2862
+ ARRAY_START_3 += 1
2863
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_3.UVScale ~= nil and 1 or 0)
2864
+ if Item_3.UVScale ~= nil then
2865
+ -- START ARRAY
2866
+ -- Allocate BLOCK: 4 bytes
2867
+ local ARRAY_START_5 = Allocate(4 * 2)
2868
+ for Index = 1, 2 do
2869
+ local Item_5 = Item_3.UVScale[Index]
2870
+ -- Allocate 4
2871
+ local OPERATION_OFFSET_0 = ARRAY_START_5
2872
+ ARRAY_START_5 += 4
2873
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
2874
+ end
2875
+ -- END ARRAY
2876
+ end
2877
+ -- Allocate 1
2878
+ local OPERATION_OFFSET_5 = ARRAY_START_3
2879
+ ARRAY_START_3 += 1
2880
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_3.ZIndex ~= nil and 1 or 0)
2881
+ if Item_3.ZIndex ~= nil then
2882
+ -- Allocate BLOCK: 4 bytes
2883
+ local BLOCK_START = Allocate(4)
2884
+ buffer.writeu32(SendBuffer, BLOCK_START + 0, Item_3.ZIndex)
2885
+ end
2886
+ -- Allocate 1
2887
+ local OPERATION_OFFSET_6 = ARRAY_START_3
2888
+ ARRAY_START_3 += 1
2889
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_3.Face ~= nil and 1 or 0)
2890
+ if Item_3.Face ~= nil then
2891
+ -- Allocate BLOCK: 1 bytes
2892
+ local BLOCK_START = Allocate(1)
2893
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Face)
2894
+ end
2895
+ -- Allocate 1
2896
+ local OPERATION_OFFSET_7 = ARRAY_START_3
2897
+ ARRAY_START_3 += 1
2898
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_7, Item_3.OffsetStudsU ~= nil and 1 or 0)
2899
+ if Item_3.OffsetStudsU ~= nil then
2900
+ -- Allocate BLOCK: 4 bytes
2901
+ local BLOCK_START = Allocate(4)
2902
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.OffsetStudsU)
2903
+ end
2904
+ -- Allocate 1
2905
+ local OPERATION_OFFSET_8 = ARRAY_START_3
2906
+ ARRAY_START_3 += 1
2907
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_8, Item_3.OffsetStudsV ~= nil and 1 or 0)
2908
+ if Item_3.OffsetStudsV ~= nil then
2909
+ -- Allocate BLOCK: 4 bytes
2910
+ local BLOCK_START = Allocate(4)
2911
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.OffsetStudsV)
2912
+ end
2913
+ -- Allocate 1
2914
+ local OPERATION_OFFSET_9 = ARRAY_START_3
2915
+ ARRAY_START_3 += 1
2916
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_9, Item_3.StudsPerTileU ~= nil and 1 or 0)
2917
+ if Item_3.StudsPerTileU ~= nil then
2918
+ -- Allocate BLOCK: 4 bytes
2919
+ local BLOCK_START = Allocate(4)
2920
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.StudsPerTileU)
2921
+ end
2922
+ -- Allocate 1
2923
+ local OPERATION_OFFSET_10 = ARRAY_START_3
2924
+ ARRAY_START_3 += 1
2925
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_10, Item_3.StudsPerTileV ~= nil and 1 or 0)
2926
+ if Item_3.StudsPerTileV ~= nil then
2927
+ -- Allocate BLOCK: 4 bytes
2928
+ local BLOCK_START = Allocate(4)
2929
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.StudsPerTileV)
2930
+ end
2931
+ end
2932
+ -- END ARRAY
2933
+ end
2934
+ local OFFSET_24 = Allocate(1)
2935
+ buffer.writeu8(SendBuffer, OFFSET_24, Element_1.Lights ~= nil and 1 or 0)
2936
+ if Element_1.Lights ~= nil then
2937
+ -- Allocate BLOCK: 2 bytes
2938
+ local BLOCK_START = Allocate(2)
2939
+ -- START ARRAY
2940
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Element_1.Lights)
2941
+ -- Allocate BLOCK: 8 bytes
2942
+ local ARRAY_START_3 = Allocate(8 * #Element_1.Lights)
2943
+ for Index = 1, #Element_1.Lights do
2944
+ local Item_3 = Element_1.Lights[Index]
2945
+ local Length = #Item_3.ClassName
2946
+ -- Allocate 2
2947
+ local OPERATION_OFFSET_0 = ARRAY_START_3
2948
+ ARRAY_START_3 += 2
2949
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_0, Length)
2950
+ Allocate(Length)
2951
+ buffer.writestring(SendBuffer, SendOffset, Item_3.ClassName, Length)
2952
+ -- Allocate 1
2953
+ local OPERATION_OFFSET_1 = ARRAY_START_3
2954
+ ARRAY_START_3 += 1
2955
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_3.Brightness ~= nil and 1 or 0)
2956
+ if Item_3.Brightness ~= nil then
2957
+ -- Allocate BLOCK: 4 bytes
2958
+ local BLOCK_START = Allocate(4)
2959
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Brightness)
2960
+ end
2961
+ -- Allocate 1
2962
+ local OPERATION_OFFSET_2 = ARRAY_START_3
2963
+ ARRAY_START_3 += 1
2964
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_3.Color ~= nil and 1 or 0)
2965
+ if Item_3.Color ~= nil then
2966
+ -- Allocate BLOCK: 3 bytes
2967
+ local BLOCK_START = Allocate(3)
2968
+ local Color = Item_3.Color
2969
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
2970
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
2971
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
2972
+ end
2973
+ -- Allocate 1
2974
+ local OPERATION_OFFSET_3 = ARRAY_START_3
2975
+ ARRAY_START_3 += 1
2976
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_3.Shadows ~= nil and 1 or 0)
2977
+ if Item_3.Shadows ~= nil then
2978
+ -- Allocate BLOCK: 1 bytes
2979
+ local BLOCK_START = Allocate(1)
2980
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Shadows and 1 or 0)
2981
+ end
2982
+ -- Allocate 1
2983
+ local OPERATION_OFFSET_4 = ARRAY_START_3
2984
+ ARRAY_START_3 += 1
2985
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_3.Range ~= nil and 1 or 0)
2986
+ if Item_3.Range ~= nil then
2987
+ -- Allocate BLOCK: 4 bytes
2988
+ local BLOCK_START = Allocate(4)
2989
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Range)
2990
+ end
2991
+ -- Allocate 1
2992
+ local OPERATION_OFFSET_5 = ARRAY_START_3
2993
+ ARRAY_START_3 += 1
2994
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_3.Angle ~= nil and 1 or 0)
2995
+ if Item_3.Angle ~= nil then
2996
+ -- Allocate BLOCK: 4 bytes
2997
+ local BLOCK_START = Allocate(4)
2998
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Angle)
2999
+ end
3000
+ -- Allocate 1
3001
+ local OPERATION_OFFSET_6 = ARRAY_START_3
3002
+ ARRAY_START_3 += 1
3003
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_3.Face ~= nil and 1 or 0)
3004
+ if Item_3.Face ~= nil then
3005
+ -- Allocate BLOCK: 1 bytes
3006
+ local BLOCK_START = Allocate(1)
3007
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Face)
3008
+ end
3009
+ end
3010
+ -- END ARRAY
3011
+ end
3012
+ local OFFSET_25 = Allocate(1)
3013
+ buffer.writeu8(SendBuffer, OFFSET_25, Element_1.Decals ~= nil and 1 or 0)
3014
+ if Element_1.Decals ~= nil then
3015
+ -- Allocate BLOCK: 2 bytes
3016
+ local BLOCK_START = Allocate(2)
3017
+ -- START ARRAY
3018
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Element_1.Decals)
3019
+ -- Allocate BLOCK: 7 bytes
3020
+ local ARRAY_START_3 = Allocate(7 * #Element_1.Decals)
3021
+ for Index = 1, #Element_1.Decals do
3022
+ local Item_3 = Element_1.Decals[Index]
3023
+ -- Allocate 1
3024
+ local OPERATION_OFFSET_0 = ARRAY_START_3
3025
+ ARRAY_START_3 += 1
3026
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_0, Item_3.Color3 ~= nil and 1 or 0)
3027
+ if Item_3.Color3 ~= nil then
3028
+ -- Allocate BLOCK: 3 bytes
3029
+ local BLOCK_START = Allocate(3)
3030
+ local Color = Item_3.Color3
3031
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
3032
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
3033
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
3034
+ end
3035
+ -- Allocate 1
3036
+ local OPERATION_OFFSET_1 = ARRAY_START_3
3037
+ ARRAY_START_3 += 1
3038
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_3.ColorMap ~= nil and 1 or 0)
3039
+ if Item_3.ColorMap ~= nil then
3040
+ -- Allocate BLOCK: 2 bytes
3041
+ local BLOCK_START = Allocate(2)
3042
+ local Length = #Item_3.ColorMap
3043
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
3044
+ Allocate(Length)
3045
+ buffer.writestring(SendBuffer, SendOffset, Item_3.ColorMap, Length)
3046
+ end
3047
+ -- Allocate 1
3048
+ local OPERATION_OFFSET_2 = ARRAY_START_3
3049
+ ARRAY_START_3 += 1
3050
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_3.Transparency ~= nil and 1 or 0)
3051
+ if Item_3.Transparency ~= nil then
3052
+ -- Allocate BLOCK: 4 bytes
3053
+ local BLOCK_START = Allocate(4)
3054
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Transparency)
3055
+ end
3056
+ -- Allocate 1
3057
+ local OPERATION_OFFSET_3 = ARRAY_START_3
3058
+ ARRAY_START_3 += 1
3059
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_3.UVOffset ~= nil and 1 or 0)
3060
+ if Item_3.UVOffset ~= nil then
3061
+ -- START ARRAY
3062
+ -- Allocate BLOCK: 4 bytes
3063
+ local ARRAY_START_5 = Allocate(4 * 2)
3064
+ for Index = 1, 2 do
3065
+ local Item_5 = Item_3.UVOffset[Index]
3066
+ -- Allocate 4
3067
+ local OPERATION_OFFSET_0 = ARRAY_START_5
3068
+ ARRAY_START_5 += 4
3069
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
3070
+ end
3071
+ -- END ARRAY
3072
+ end
3073
+ -- Allocate 1
3074
+ local OPERATION_OFFSET_4 = ARRAY_START_3
3075
+ ARRAY_START_3 += 1
3076
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_3.UVScale ~= nil and 1 or 0)
3077
+ if Item_3.UVScale ~= nil then
3078
+ -- START ARRAY
3079
+ -- Allocate BLOCK: 4 bytes
3080
+ local ARRAY_START_5 = Allocate(4 * 2)
3081
+ for Index = 1, 2 do
3082
+ local Item_5 = Item_3.UVScale[Index]
3083
+ -- Allocate 4
3084
+ local OPERATION_OFFSET_0 = ARRAY_START_5
3085
+ ARRAY_START_5 += 4
3086
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
3087
+ end
3088
+ -- END ARRAY
3089
+ end
3090
+ -- Allocate 1
3091
+ local OPERATION_OFFSET_5 = ARRAY_START_3
3092
+ ARRAY_START_3 += 1
3093
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_3.ZIndex ~= nil and 1 or 0)
3094
+ if Item_3.ZIndex ~= nil then
3095
+ -- Allocate BLOCK: 4 bytes
3096
+ local BLOCK_START = Allocate(4)
3097
+ buffer.writeu32(SendBuffer, BLOCK_START + 0, Item_3.ZIndex)
3098
+ end
3099
+ -- Allocate 1
3100
+ local OPERATION_OFFSET_6 = ARRAY_START_3
3101
+ ARRAY_START_3 += 1
3102
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_3.Face ~= nil and 1 or 0)
3103
+ if Item_3.Face ~= nil then
3104
+ -- Allocate BLOCK: 1 bytes
3105
+ local BLOCK_START = Allocate(1)
3106
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Face)
3107
+ end
3108
+ end
3109
+ -- END ARRAY
3110
+ end
3111
+ local OFFSET_26 = Allocate(2)
3112
+ local Elements_2 = 0
3113
+ for Key_2, Element_2 in Element_1.Attributes do
3114
+ Elements_2 += 1
3115
+ local Length = #Key_2
3116
+ local OFFSET_0 = Allocate(2)
3117
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
3118
+ Allocate(Length)
3119
+ buffer.writestring(SendBuffer, SendOffset, Key_2, Length)
3120
+ table.insert(SendInstances, if Element_2 == nil then Null else Element_2)
3121
+ end
3122
+ buffer.writeu16(SendBuffer, OFFSET_26, Elements_2)
3123
+ -- START ARRAY
3124
+ local OFFSET_27 = Allocate(2)
3125
+ buffer.writeu16(SendBuffer, OFFSET_27, #Element_1.Tags)
3126
+ -- Allocate BLOCK: 2 bytes
3127
+ local ARRAY_START_2 = Allocate(2 * #Element_1.Tags)
3128
+ for Index = 1, #Element_1.Tags do
3129
+ local Item_2 = Element_1.Tags[Index]
3130
+ local Length = #Item_2
3131
+ -- Allocate 2
3132
+ local OPERATION_OFFSET_0 = ARRAY_START_2
3133
+ ARRAY_START_2 += 2
3134
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_0, Length)
3135
+ Allocate(Length)
3136
+ buffer.writestring(SendBuffer, SendOffset, Item_2, Length)
3137
+ end
3138
+ -- END ARRAY
3139
+ end
3140
+ buffer.writeu16(SendBuffer, BLOCK_START + 19, Elements_1)
3141
+ buffer.writeu16(SendBuffer, BLOCK_START + 21, Value11)
3142
+ end
3143
+
3144
+ local function Shatterbox_WriteEVENT_ReplicateDestruction(Value1: string, Value2: { ID: string, CuttingPart: { CFrame: CFrame, Size: Vector3, Shape: number }, FilterTagged: { string }?, GridSize: number?, CleanupDelay: number?, SkipWalls: boolean?, SkipFloors: boolean?, SkipEncapsulatedVoxels: boolean?, OnVoxelDestruct: string?, UserData: any? }, Value3: {[string]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}, Value4: {[string]: boolean}?): ()
3145
+ -- Allocate BLOCK: 53 bytes
3146
+ local BLOCK_START = Allocate(53)
3147
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, 8)
3148
+ local Length = #Value1
3149
+ buffer.writeu16(SendBuffer, BLOCK_START + 1, Length)
3150
+ Allocate(Length)
3151
+ buffer.writestring(SendBuffer, SendOffset, Value1, Length)
3152
+ local Length = #Value2.ID
3153
+ buffer.writeu16(SendBuffer, BLOCK_START + 3, Length)
3154
+ Allocate(Length)
3155
+ buffer.writestring(SendBuffer, SendOffset, Value2.ID, Length)
3156
+ local Vector = Value2.CuttingPart.CFrame.Position
3157
+ buffer.writef32(SendBuffer, BLOCK_START + 5, Vector.X)
3158
+ buffer.writef32(SendBuffer, BLOCK_START + 9, Vector.Y)
3159
+ buffer.writef32(SendBuffer, BLOCK_START + 13, Vector.Z)
3160
+ local rX, rY, rZ = Value2.CuttingPart.CFrame:ToOrientation()
3161
+ buffer.writef32(SendBuffer, BLOCK_START + 17, rX)
3162
+ buffer.writef32(SendBuffer, BLOCK_START + 21, rY)
3163
+ buffer.writef32(SendBuffer, BLOCK_START + 25, rZ)
3164
+ local Vector = Value2.CuttingPart.Size
3165
+ buffer.writef32(SendBuffer, BLOCK_START + 29, Vector.X)
3166
+ buffer.writef32(SendBuffer, BLOCK_START + 33, Vector.Y)
3167
+ buffer.writef32(SendBuffer, BLOCK_START + 37, Vector.Z)
3168
+ buffer.writeu8(SendBuffer, BLOCK_START + 41, Value2.CuttingPart.Shape)
3169
+ buffer.writeu8(SendBuffer, BLOCK_START + 42, Value2.FilterTagged ~= nil and 1 or 0)
3170
+ if Value2.FilterTagged ~= nil then
3171
+ -- Allocate BLOCK: 2 bytes
3172
+ local BLOCK_START = Allocate(2)
3173
+ -- START ARRAY
3174
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Value2.FilterTagged)
3175
+ -- Allocate BLOCK: 2 bytes
3176
+ local ARRAY_START_2 = Allocate(2 * #Value2.FilterTagged)
3177
+ for Index = 1, #Value2.FilterTagged do
3178
+ local Item_2 = Value2.FilterTagged[Index]
3179
+ local Length = #Item_2
3180
+ -- Allocate 2
3181
+ local OPERATION_OFFSET_0 = ARRAY_START_2
3182
+ ARRAY_START_2 += 2
3183
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_0, Length)
3184
+ Allocate(Length)
3185
+ buffer.writestring(SendBuffer, SendOffset, Item_2, Length)
3186
+ end
3187
+ -- END ARRAY
3188
+ end
3189
+ buffer.writeu8(SendBuffer, BLOCK_START + 43, Value2.GridSize ~= nil and 1 or 0)
3190
+ if Value2.GridSize ~= nil then
3191
+ -- Allocate BLOCK: 4 bytes
3192
+ local BLOCK_START = Allocate(4)
3193
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Value2.GridSize)
3194
+ end
3195
+ buffer.writeu8(SendBuffer, BLOCK_START + 44, Value2.CleanupDelay ~= nil and 1 or 0)
3196
+ if Value2.CleanupDelay ~= nil then
3197
+ -- Allocate BLOCK: 4 bytes
3198
+ local BLOCK_START = Allocate(4)
3199
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Value2.CleanupDelay)
3200
+ end
3201
+ buffer.writeu8(SendBuffer, BLOCK_START + 45, Value2.SkipWalls ~= nil and 1 or 0)
3202
+ if Value2.SkipWalls ~= nil then
3203
+ -- Allocate BLOCK: 1 bytes
3204
+ local BLOCK_START = Allocate(1)
3205
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Value2.SkipWalls and 1 or 0)
3206
+ end
3207
+ buffer.writeu8(SendBuffer, BLOCK_START + 46, Value2.SkipFloors ~= nil and 1 or 0)
3208
+ if Value2.SkipFloors ~= nil then
3209
+ -- Allocate BLOCK: 1 bytes
3210
+ local BLOCK_START = Allocate(1)
3211
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Value2.SkipFloors and 1 or 0)
3212
+ end
3213
+ buffer.writeu8(SendBuffer, BLOCK_START + 47, Value2.SkipEncapsulatedVoxels ~= nil and 1 or 0)
3214
+ if Value2.SkipEncapsulatedVoxels ~= nil then
3215
+ -- Allocate BLOCK: 1 bytes
3216
+ local BLOCK_START = Allocate(1)
3217
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Value2.SkipEncapsulatedVoxels and 1 or 0)
3218
+ end
3219
+ buffer.writeu8(SendBuffer, BLOCK_START + 48, Value2.OnVoxelDestruct ~= nil and 1 or 0)
3220
+ if Value2.OnVoxelDestruct ~= nil then
3221
+ -- Allocate BLOCK: 2 bytes
3222
+ local BLOCK_START = Allocate(2)
3223
+ local Length = #Value2.OnVoxelDestruct
3224
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
3225
+ Allocate(Length)
3226
+ buffer.writestring(SendBuffer, SendOffset, Value2.OnVoxelDestruct, Length)
3227
+ end
3228
+ buffer.writeu8(SendBuffer, BLOCK_START + 49, Value2.UserData ~= nil and 1 or 0)
3229
+ if Value2.UserData ~= nil then
3230
+ table.insert(SendInstances, if Value2.UserData == nil then Null else Value2.UserData)
3231
+ end
3232
+ local Elements_1 = 0
3233
+ for Key_1, Element_1 in Value3 do
3234
+ Elements_1 += 1
3235
+ local Length = #Key_1
3236
+ local OFFSET_0 = Allocate(2)
3237
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
3238
+ Allocate(Length)
3239
+ buffer.writestring(SendBuffer, SendOffset, Key_1, Length)
3240
+ local Vector = Element_1.CFrame.Position
3241
+ local OFFSET_1 = Allocate(4)
3242
+ buffer.writef32(SendBuffer, OFFSET_1, Vector.X)
3243
+ local OFFSET_2 = Allocate(4)
3244
+ buffer.writef32(SendBuffer, OFFSET_2, Vector.Y)
3245
+ local OFFSET_3 = Allocate(4)
3246
+ buffer.writef32(SendBuffer, OFFSET_3, Vector.Z)
3247
+ local rX, rY, rZ = Element_1.CFrame:ToOrientation()
3248
+ local OFFSET_4 = Allocate(4)
3249
+ buffer.writef32(SendBuffer, OFFSET_4, rX)
3250
+ local OFFSET_5 = Allocate(4)
3251
+ buffer.writef32(SendBuffer, OFFSET_5, rY)
3252
+ local OFFSET_6 = Allocate(4)
3253
+ buffer.writef32(SendBuffer, OFFSET_6, rZ)
3254
+ local Vector = Element_1.Size
3255
+ local OFFSET_7 = Allocate(4)
3256
+ buffer.writef32(SendBuffer, OFFSET_7, Vector.X)
3257
+ local OFFSET_8 = Allocate(4)
3258
+ buffer.writef32(SendBuffer, OFFSET_8, Vector.Y)
3259
+ local OFFSET_9 = Allocate(4)
3260
+ buffer.writef32(SendBuffer, OFFSET_9, Vector.Z)
3261
+ local OFFSET_10 = Allocate(1)
3262
+ buffer.writeu8(SendBuffer, OFFSET_10, Element_1.Anchored and 1 or 0)
3263
+ local OFFSET_11 = Allocate(1)
3264
+ buffer.writeu8(SendBuffer, OFFSET_11, Element_1.Color ~= nil and 1 or 0)
3265
+ if Element_1.Color ~= nil then
3266
+ -- Allocate BLOCK: 3 bytes
3267
+ local BLOCK_START = Allocate(3)
3268
+ local Color = Element_1.Color
3269
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
3270
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
3271
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
3272
+ end
3273
+ local OFFSET_12 = Allocate(1)
3274
+ buffer.writeu8(SendBuffer, OFFSET_12, Element_1.Material ~= nil and 1 or 0)
3275
+ if Element_1.Material ~= nil then
3276
+ -- Allocate BLOCK: 2 bytes
3277
+ local BLOCK_START = Allocate(2)
3278
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Element_1.Material)
3279
+ end
3280
+ local OFFSET_13 = Allocate(1)
3281
+ buffer.writeu8(SendBuffer, OFFSET_13, Element_1.Transparency ~= nil and 1 or 0)
3282
+ if Element_1.Transparency ~= nil then
3283
+ -- Allocate BLOCK: 2 bytes
3284
+ local BLOCK_START = Allocate(2)
3285
+ if Element_1.Transparency > 65504 then
3286
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b0_11111_0000000000)
3287
+ elseif Element_1.Transparency < -65504 then
3288
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000000)
3289
+ elseif Element_1.Transparency ~= Element_1.Transparency then
3290
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000001)
3291
+ elseif Element_1.Transparency == 0 then
3292
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0)
3293
+ else
3294
+ local float = Element_1.Transparency
3295
+ local Abosulte = math.abs(float)
3296
+ local Interval = math.ldexp(1, math.floor(math.log(Abosulte, 2)) - 10)
3297
+ local RoundedValue = (Abosulte // Interval) * Interval
3298
+ local Fraction, Exponent = math.frexp(RoundedValue)
3299
+ Exponent += 14
3300
+ local Mantissa = math.round(if Exponent <= 0
3301
+ then Fraction * 0x400 / math.ldexp(1, math.abs(Exponent))
3302
+ else Fraction * 0x800) % 0x400
3303
+ local Result = Mantissa
3304
+ + math.max(Exponent, 0) * 0x400
3305
+ + if float < 0 then 0x8000 else 0
3306
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Result)
3307
+ end
3308
+ end
3309
+ local OFFSET_14 = Allocate(1)
3310
+ buffer.writeu8(SendBuffer, OFFSET_14, Element_1.Reflectance ~= nil and 1 or 0)
3311
+ if Element_1.Reflectance ~= nil then
3312
+ -- Allocate BLOCK: 2 bytes
3313
+ local BLOCK_START = Allocate(2)
3314
+ if Element_1.Reflectance > 65504 then
3315
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b0_11111_0000000000)
3316
+ elseif Element_1.Reflectance < -65504 then
3317
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000000)
3318
+ elseif Element_1.Reflectance ~= Element_1.Reflectance then
3319
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0b1_11111_0000000001)
3320
+ elseif Element_1.Reflectance == 0 then
3321
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, 0)
3322
+ else
3323
+ local float = Element_1.Reflectance
3324
+ local Abosulte = math.abs(float)
3325
+ local Interval = math.ldexp(1, math.floor(math.log(Abosulte, 2)) - 10)
3326
+ local RoundedValue = (Abosulte // Interval) * Interval
3327
+ local Fraction, Exponent = math.frexp(RoundedValue)
3328
+ Exponent += 14
3329
+ local Mantissa = math.round(if Exponent <= 0
3330
+ then Fraction * 0x400 / math.ldexp(1, math.abs(Exponent))
3331
+ else Fraction * 0x800) % 0x400
3332
+ local Result = Mantissa
3333
+ + math.max(Exponent, 0) * 0x400
3334
+ + if float < 0 then 0x8000 else 0
3335
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Result)
3336
+ end
3337
+ end
3338
+ local OFFSET_15 = Allocate(1)
3339
+ buffer.writeu8(SendBuffer, OFFSET_15, Element_1.MaterialVariant ~= nil and 1 or 0)
3340
+ if Element_1.MaterialVariant ~= nil then
3341
+ -- Allocate BLOCK: 2 bytes
3342
+ local BLOCK_START = Allocate(2)
3343
+ local Length = #Element_1.MaterialVariant
3344
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
3345
+ Allocate(Length)
3346
+ buffer.writestring(SendBuffer, SendOffset, Element_1.MaterialVariant, Length)
3347
+ end
3348
+ local OFFSET_16 = Allocate(1)
3349
+ buffer.writeu8(SendBuffer, OFFSET_16, Element_1.CollisionGroup ~= nil and 1 or 0)
3350
+ if Element_1.CollisionGroup ~= nil then
3351
+ -- Allocate BLOCK: 2 bytes
3352
+ local BLOCK_START = Allocate(2)
3353
+ local Length = #Element_1.CollisionGroup
3354
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
3355
+ Allocate(Length)
3356
+ buffer.writestring(SendBuffer, SendOffset, Element_1.CollisionGroup, Length)
3357
+ end
3358
+ local OFFSET_17 = Allocate(1)
3359
+ buffer.writeu8(SendBuffer, OFFSET_17, Element_1.LeftSurface ~= nil and 1 or 0)
3360
+ if Element_1.LeftSurface ~= nil then
3361
+ -- Allocate BLOCK: 1 bytes
3362
+ local BLOCK_START = Allocate(1)
3363
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.LeftSurface)
3364
+ end
3365
+ local OFFSET_18 = Allocate(1)
3366
+ buffer.writeu8(SendBuffer, OFFSET_18, Element_1.RightSurface ~= nil and 1 or 0)
3367
+ if Element_1.RightSurface ~= nil then
3368
+ -- Allocate BLOCK: 1 bytes
3369
+ local BLOCK_START = Allocate(1)
3370
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.RightSurface)
3371
+ end
3372
+ local OFFSET_19 = Allocate(1)
3373
+ buffer.writeu8(SendBuffer, OFFSET_19, Element_1.FrontSurface ~= nil and 1 or 0)
3374
+ if Element_1.FrontSurface ~= nil then
3375
+ -- Allocate BLOCK: 1 bytes
3376
+ local BLOCK_START = Allocate(1)
3377
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.FrontSurface)
3378
+ end
3379
+ local OFFSET_20 = Allocate(1)
3380
+ buffer.writeu8(SendBuffer, OFFSET_20, Element_1.BackSurface ~= nil and 1 or 0)
3381
+ if Element_1.BackSurface ~= nil then
3382
+ -- Allocate BLOCK: 1 bytes
3383
+ local BLOCK_START = Allocate(1)
3384
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.BackSurface)
3385
+ end
3386
+ local OFFSET_21 = Allocate(1)
3387
+ buffer.writeu8(SendBuffer, OFFSET_21, Element_1.TopSurface ~= nil and 1 or 0)
3388
+ if Element_1.TopSurface ~= nil then
3389
+ -- Allocate BLOCK: 1 bytes
3390
+ local BLOCK_START = Allocate(1)
3391
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.TopSurface)
3392
+ end
3393
+ local OFFSET_22 = Allocate(1)
3394
+ buffer.writeu8(SendBuffer, OFFSET_22, Element_1.BottomSurface ~= nil and 1 or 0)
3395
+ if Element_1.BottomSurface ~= nil then
3396
+ -- Allocate BLOCK: 1 bytes
3397
+ local BLOCK_START = Allocate(1)
3398
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Element_1.BottomSurface)
3399
+ end
3400
+ local OFFSET_23 = Allocate(1)
3401
+ buffer.writeu8(SendBuffer, OFFSET_23, Element_1.Textures ~= nil and 1 or 0)
3402
+ if Element_1.Textures ~= nil then
3403
+ -- Allocate BLOCK: 2 bytes
3404
+ local BLOCK_START = Allocate(2)
3405
+ -- START ARRAY
3406
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Element_1.Textures)
3407
+ -- Allocate BLOCK: 11 bytes
3408
+ local ARRAY_START_3 = Allocate(11 * #Element_1.Textures)
3409
+ for Index = 1, #Element_1.Textures do
3410
+ local Item_3 = Element_1.Textures[Index]
3411
+ -- Allocate 1
3412
+ local OPERATION_OFFSET_0 = ARRAY_START_3
3413
+ ARRAY_START_3 += 1
3414
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_0, Item_3.Color3 ~= nil and 1 or 0)
3415
+ if Item_3.Color3 ~= nil then
3416
+ -- Allocate BLOCK: 3 bytes
3417
+ local BLOCK_START = Allocate(3)
3418
+ local Color = Item_3.Color3
3419
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
3420
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
3421
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
3422
+ end
3423
+ -- Allocate 1
3424
+ local OPERATION_OFFSET_1 = ARRAY_START_3
3425
+ ARRAY_START_3 += 1
3426
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_3.ColorMap ~= nil and 1 or 0)
3427
+ if Item_3.ColorMap ~= nil then
3428
+ -- Allocate BLOCK: 2 bytes
3429
+ local BLOCK_START = Allocate(2)
3430
+ local Length = #Item_3.ColorMap
3431
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
3432
+ Allocate(Length)
3433
+ buffer.writestring(SendBuffer, SendOffset, Item_3.ColorMap, Length)
3434
+ end
3435
+ -- Allocate 1
3436
+ local OPERATION_OFFSET_2 = ARRAY_START_3
3437
+ ARRAY_START_3 += 1
3438
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_3.Transparency ~= nil and 1 or 0)
3439
+ if Item_3.Transparency ~= nil then
3440
+ -- Allocate BLOCK: 4 bytes
3441
+ local BLOCK_START = Allocate(4)
3442
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Transparency)
3443
+ end
3444
+ -- Allocate 1
3445
+ local OPERATION_OFFSET_3 = ARRAY_START_3
3446
+ ARRAY_START_3 += 1
3447
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_3.UVOffset ~= nil and 1 or 0)
3448
+ if Item_3.UVOffset ~= nil then
3449
+ -- START ARRAY
3450
+ -- Allocate BLOCK: 4 bytes
3451
+ local ARRAY_START_5 = Allocate(4 * 2)
3452
+ for Index = 1, 2 do
3453
+ local Item_5 = Item_3.UVOffset[Index]
3454
+ -- Allocate 4
3455
+ local OPERATION_OFFSET_0 = ARRAY_START_5
3456
+ ARRAY_START_5 += 4
3457
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
3458
+ end
3459
+ -- END ARRAY
3460
+ end
3461
+ -- Allocate 1
3462
+ local OPERATION_OFFSET_4 = ARRAY_START_3
3463
+ ARRAY_START_3 += 1
3464
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_3.UVScale ~= nil and 1 or 0)
3465
+ if Item_3.UVScale ~= nil then
3466
+ -- START ARRAY
3467
+ -- Allocate BLOCK: 4 bytes
3468
+ local ARRAY_START_5 = Allocate(4 * 2)
3469
+ for Index = 1, 2 do
3470
+ local Item_5 = Item_3.UVScale[Index]
3471
+ -- Allocate 4
3472
+ local OPERATION_OFFSET_0 = ARRAY_START_5
3473
+ ARRAY_START_5 += 4
3474
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
3475
+ end
3476
+ -- END ARRAY
3477
+ end
3478
+ -- Allocate 1
3479
+ local OPERATION_OFFSET_5 = ARRAY_START_3
3480
+ ARRAY_START_3 += 1
3481
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_3.ZIndex ~= nil and 1 or 0)
3482
+ if Item_3.ZIndex ~= nil then
3483
+ -- Allocate BLOCK: 4 bytes
3484
+ local BLOCK_START = Allocate(4)
3485
+ buffer.writeu32(SendBuffer, BLOCK_START + 0, Item_3.ZIndex)
3486
+ end
3487
+ -- Allocate 1
3488
+ local OPERATION_OFFSET_6 = ARRAY_START_3
3489
+ ARRAY_START_3 += 1
3490
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_3.Face ~= nil and 1 or 0)
3491
+ if Item_3.Face ~= nil then
3492
+ -- Allocate BLOCK: 1 bytes
3493
+ local BLOCK_START = Allocate(1)
3494
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Face)
3495
+ end
3496
+ -- Allocate 1
3497
+ local OPERATION_OFFSET_7 = ARRAY_START_3
3498
+ ARRAY_START_3 += 1
3499
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_7, Item_3.OffsetStudsU ~= nil and 1 or 0)
3500
+ if Item_3.OffsetStudsU ~= nil then
3501
+ -- Allocate BLOCK: 4 bytes
3502
+ local BLOCK_START = Allocate(4)
3503
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.OffsetStudsU)
3504
+ end
3505
+ -- Allocate 1
3506
+ local OPERATION_OFFSET_8 = ARRAY_START_3
3507
+ ARRAY_START_3 += 1
3508
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_8, Item_3.OffsetStudsV ~= nil and 1 or 0)
3509
+ if Item_3.OffsetStudsV ~= nil then
3510
+ -- Allocate BLOCK: 4 bytes
3511
+ local BLOCK_START = Allocate(4)
3512
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.OffsetStudsV)
3513
+ end
3514
+ -- Allocate 1
3515
+ local OPERATION_OFFSET_9 = ARRAY_START_3
3516
+ ARRAY_START_3 += 1
3517
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_9, Item_3.StudsPerTileU ~= nil and 1 or 0)
3518
+ if Item_3.StudsPerTileU ~= nil then
3519
+ -- Allocate BLOCK: 4 bytes
3520
+ local BLOCK_START = Allocate(4)
3521
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.StudsPerTileU)
3522
+ end
3523
+ -- Allocate 1
3524
+ local OPERATION_OFFSET_10 = ARRAY_START_3
3525
+ ARRAY_START_3 += 1
3526
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_10, Item_3.StudsPerTileV ~= nil and 1 or 0)
3527
+ if Item_3.StudsPerTileV ~= nil then
3528
+ -- Allocate BLOCK: 4 bytes
3529
+ local BLOCK_START = Allocate(4)
3530
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.StudsPerTileV)
3531
+ end
3532
+ end
3533
+ -- END ARRAY
3534
+ end
3535
+ local OFFSET_24 = Allocate(1)
3536
+ buffer.writeu8(SendBuffer, OFFSET_24, Element_1.Lights ~= nil and 1 or 0)
3537
+ if Element_1.Lights ~= nil then
3538
+ -- Allocate BLOCK: 2 bytes
3539
+ local BLOCK_START = Allocate(2)
3540
+ -- START ARRAY
3541
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Element_1.Lights)
3542
+ -- Allocate BLOCK: 8 bytes
3543
+ local ARRAY_START_3 = Allocate(8 * #Element_1.Lights)
3544
+ for Index = 1, #Element_1.Lights do
3545
+ local Item_3 = Element_1.Lights[Index]
3546
+ local Length = #Item_3.ClassName
3547
+ -- Allocate 2
3548
+ local OPERATION_OFFSET_0 = ARRAY_START_3
3549
+ ARRAY_START_3 += 2
3550
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_0, Length)
3551
+ Allocate(Length)
3552
+ buffer.writestring(SendBuffer, SendOffset, Item_3.ClassName, Length)
3553
+ -- Allocate 1
3554
+ local OPERATION_OFFSET_1 = ARRAY_START_3
3555
+ ARRAY_START_3 += 1
3556
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_3.Brightness ~= nil and 1 or 0)
3557
+ if Item_3.Brightness ~= nil then
3558
+ -- Allocate BLOCK: 4 bytes
3559
+ local BLOCK_START = Allocate(4)
3560
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Brightness)
3561
+ end
3562
+ -- Allocate 1
3563
+ local OPERATION_OFFSET_2 = ARRAY_START_3
3564
+ ARRAY_START_3 += 1
3565
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_3.Color ~= nil and 1 or 0)
3566
+ if Item_3.Color ~= nil then
3567
+ -- Allocate BLOCK: 3 bytes
3568
+ local BLOCK_START = Allocate(3)
3569
+ local Color = Item_3.Color
3570
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
3571
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
3572
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
3573
+ end
3574
+ -- Allocate 1
3575
+ local OPERATION_OFFSET_3 = ARRAY_START_3
3576
+ ARRAY_START_3 += 1
3577
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_3.Shadows ~= nil and 1 or 0)
3578
+ if Item_3.Shadows ~= nil then
3579
+ -- Allocate BLOCK: 1 bytes
3580
+ local BLOCK_START = Allocate(1)
3581
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Shadows and 1 or 0)
3582
+ end
3583
+ -- Allocate 1
3584
+ local OPERATION_OFFSET_4 = ARRAY_START_3
3585
+ ARRAY_START_3 += 1
3586
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_3.Range ~= nil and 1 or 0)
3587
+ if Item_3.Range ~= nil then
3588
+ -- Allocate BLOCK: 4 bytes
3589
+ local BLOCK_START = Allocate(4)
3590
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Range)
3591
+ end
3592
+ -- Allocate 1
3593
+ local OPERATION_OFFSET_5 = ARRAY_START_3
3594
+ ARRAY_START_3 += 1
3595
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_3.Angle ~= nil and 1 or 0)
3596
+ if Item_3.Angle ~= nil then
3597
+ -- Allocate BLOCK: 4 bytes
3598
+ local BLOCK_START = Allocate(4)
3599
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Angle)
3600
+ end
3601
+ -- Allocate 1
3602
+ local OPERATION_OFFSET_6 = ARRAY_START_3
3603
+ ARRAY_START_3 += 1
3604
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_3.Face ~= nil and 1 or 0)
3605
+ if Item_3.Face ~= nil then
3606
+ -- Allocate BLOCK: 1 bytes
3607
+ local BLOCK_START = Allocate(1)
3608
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Face)
3609
+ end
3610
+ end
3611
+ -- END ARRAY
3612
+ end
3613
+ local OFFSET_25 = Allocate(1)
3614
+ buffer.writeu8(SendBuffer, OFFSET_25, Element_1.Decals ~= nil and 1 or 0)
3615
+ if Element_1.Decals ~= nil then
3616
+ -- Allocate BLOCK: 2 bytes
3617
+ local BLOCK_START = Allocate(2)
3618
+ -- START ARRAY
3619
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, #Element_1.Decals)
3620
+ -- Allocate BLOCK: 7 bytes
3621
+ local ARRAY_START_3 = Allocate(7 * #Element_1.Decals)
3622
+ for Index = 1, #Element_1.Decals do
3623
+ local Item_3 = Element_1.Decals[Index]
3624
+ -- Allocate 1
3625
+ local OPERATION_OFFSET_0 = ARRAY_START_3
3626
+ ARRAY_START_3 += 1
3627
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_0, Item_3.Color3 ~= nil and 1 or 0)
3628
+ if Item_3.Color3 ~= nil then
3629
+ -- Allocate BLOCK: 3 bytes
3630
+ local BLOCK_START = Allocate(3)
3631
+ local Color = Item_3.Color3
3632
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Color.R * 255)
3633
+ buffer.writeu8(SendBuffer, BLOCK_START + 1, Color.G * 255)
3634
+ buffer.writeu8(SendBuffer, BLOCK_START + 2, Color.B * 255)
3635
+ end
3636
+ -- Allocate 1
3637
+ local OPERATION_OFFSET_1 = ARRAY_START_3
3638
+ ARRAY_START_3 += 1
3639
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_1, Item_3.ColorMap ~= nil and 1 or 0)
3640
+ if Item_3.ColorMap ~= nil then
3641
+ -- Allocate BLOCK: 2 bytes
3642
+ local BLOCK_START = Allocate(2)
3643
+ local Length = #Item_3.ColorMap
3644
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Length)
3645
+ Allocate(Length)
3646
+ buffer.writestring(SendBuffer, SendOffset, Item_3.ColorMap, Length)
3647
+ end
3648
+ -- Allocate 1
3649
+ local OPERATION_OFFSET_2 = ARRAY_START_3
3650
+ ARRAY_START_3 += 1
3651
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_2, Item_3.Transparency ~= nil and 1 or 0)
3652
+ if Item_3.Transparency ~= nil then
3653
+ -- Allocate BLOCK: 4 bytes
3654
+ local BLOCK_START = Allocate(4)
3655
+ buffer.writef32(SendBuffer, BLOCK_START + 0, Item_3.Transparency)
3656
+ end
3657
+ -- Allocate 1
3658
+ local OPERATION_OFFSET_3 = ARRAY_START_3
3659
+ ARRAY_START_3 += 1
3660
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_3, Item_3.UVOffset ~= nil and 1 or 0)
3661
+ if Item_3.UVOffset ~= nil then
3662
+ -- START ARRAY
3663
+ -- Allocate BLOCK: 4 bytes
3664
+ local ARRAY_START_5 = Allocate(4 * 2)
3665
+ for Index = 1, 2 do
3666
+ local Item_5 = Item_3.UVOffset[Index]
3667
+ -- Allocate 4
3668
+ local OPERATION_OFFSET_0 = ARRAY_START_5
3669
+ ARRAY_START_5 += 4
3670
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
3671
+ end
3672
+ -- END ARRAY
3673
+ end
3674
+ -- Allocate 1
3675
+ local OPERATION_OFFSET_4 = ARRAY_START_3
3676
+ ARRAY_START_3 += 1
3677
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_4, Item_3.UVScale ~= nil and 1 or 0)
3678
+ if Item_3.UVScale ~= nil then
3679
+ -- START ARRAY
3680
+ -- Allocate BLOCK: 4 bytes
3681
+ local ARRAY_START_5 = Allocate(4 * 2)
3682
+ for Index = 1, 2 do
3683
+ local Item_5 = Item_3.UVScale[Index]
3684
+ -- Allocate 4
3685
+ local OPERATION_OFFSET_0 = ARRAY_START_5
3686
+ ARRAY_START_5 += 4
3687
+ buffer.writef32(SendBuffer, OPERATION_OFFSET_0, Item_5)
3688
+ end
3689
+ -- END ARRAY
3690
+ end
3691
+ -- Allocate 1
3692
+ local OPERATION_OFFSET_5 = ARRAY_START_3
3693
+ ARRAY_START_3 += 1
3694
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_5, Item_3.ZIndex ~= nil and 1 or 0)
3695
+ if Item_3.ZIndex ~= nil then
3696
+ -- Allocate BLOCK: 4 bytes
3697
+ local BLOCK_START = Allocate(4)
3698
+ buffer.writeu32(SendBuffer, BLOCK_START + 0, Item_3.ZIndex)
3699
+ end
3700
+ -- Allocate 1
3701
+ local OPERATION_OFFSET_6 = ARRAY_START_3
3702
+ ARRAY_START_3 += 1
3703
+ buffer.writeu8(SendBuffer, OPERATION_OFFSET_6, Item_3.Face ~= nil and 1 or 0)
3704
+ if Item_3.Face ~= nil then
3705
+ -- Allocate BLOCK: 1 bytes
3706
+ local BLOCK_START = Allocate(1)
3707
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, Item_3.Face)
3708
+ end
3709
+ end
3710
+ -- END ARRAY
3711
+ end
3712
+ local OFFSET_26 = Allocate(2)
3713
+ local Elements_2 = 0
3714
+ for Key_2, Element_2 in Element_1.Attributes do
3715
+ Elements_2 += 1
3716
+ local Length = #Key_2
3717
+ local OFFSET_0 = Allocate(2)
3718
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
3719
+ Allocate(Length)
3720
+ buffer.writestring(SendBuffer, SendOffset, Key_2, Length)
3721
+ table.insert(SendInstances, if Element_2 == nil then Null else Element_2)
3722
+ end
3723
+ buffer.writeu16(SendBuffer, OFFSET_26, Elements_2)
3724
+ -- START ARRAY
3725
+ local OFFSET_27 = Allocate(2)
3726
+ buffer.writeu16(SendBuffer, OFFSET_27, #Element_1.Tags)
3727
+ -- Allocate BLOCK: 2 bytes
3728
+ local ARRAY_START_2 = Allocate(2 * #Element_1.Tags)
3729
+ for Index = 1, #Element_1.Tags do
3730
+ local Item_2 = Element_1.Tags[Index]
3731
+ local Length = #Item_2
3732
+ -- Allocate 2
3733
+ local OPERATION_OFFSET_0 = ARRAY_START_2
3734
+ ARRAY_START_2 += 2
3735
+ buffer.writeu16(SendBuffer, OPERATION_OFFSET_0, Length)
3736
+ Allocate(Length)
3737
+ buffer.writestring(SendBuffer, SendOffset, Item_2, Length)
3738
+ end
3739
+ -- END ARRAY
3740
+ end
3741
+ buffer.writeu16(SendBuffer, BLOCK_START + 50, Elements_1)
3742
+ buffer.writeu8(SendBuffer, BLOCK_START + 52, Value4 ~= nil and 1 or 0)
3743
+ if Value4 ~= nil then
3744
+ -- Allocate BLOCK: 2 bytes
3745
+ local BLOCK_START = Allocate(2)
3746
+ local Elements_2 = 0
3747
+ for Key_2, Element_2 in Value4 do
3748
+ Elements_2 += 1
3749
+ local Length = #Key_2
3750
+ local OFFSET_0 = Allocate(2)
3751
+ buffer.writeu16(SendBuffer, OFFSET_0, Length)
3752
+ Allocate(Length)
3753
+ buffer.writestring(SendBuffer, SendOffset, Key_2, Length)
3754
+ local OFFSET_1 = Allocate(1)
3755
+ buffer.writeu8(SendBuffer, OFFSET_1, Element_2 and 1 or 0)
3756
+ end
3757
+ buffer.writeu16(SendBuffer, BLOCK_START + 0, Elements_2)
3758
+ end
3759
+ end
3760
+
3761
+ local function Shatterbox_ReadEVENT_ClientInitComplete(): (nil)
3762
+ return nil
3763
+ end
3764
+
3765
+ local function Shatterbox_WriteEVENT_SignalPrintState(Value: nil): ()
3766
+ -- Allocate BLOCK: 1 bytes
3767
+ local BLOCK_START = Allocate(1)
3768
+ buffer.writeu8(SendBuffer, BLOCK_START + 0, 10)
3769
+ end
3770
+
3771
+ if not RunService:IsRunning() then
3772
+ local NOOP = function() end
3773
+ local Returns = table.freeze({
3774
+ Shatterbox = {
3775
+ SignalClearQueue = {
3776
+ Fire = NOOP,
3777
+ FireAll = NOOP,
3778
+ FireList = NOOP,
3779
+ FireExcept = NOOP
3780
+ },
3781
+ SignalReset = {
3782
+ Fire = NOOP,
3783
+ FireAll = NOOP,
3784
+ FireList = NOOP,
3785
+ FireExcept = NOOP
3786
+ },
3787
+ SignalResetArea = {
3788
+ Fire = NOOP,
3789
+ FireAll = NOOP,
3790
+ FireList = NOOP,
3791
+ FireExcept = NOOP
3792
+ },
3793
+ CreatePuppets = {
3794
+ Fire = NOOP,
3795
+ FireAll = NOOP,
3796
+ FireList = NOOP,
3797
+ FireExcept = NOOP
3798
+ },
3799
+ ReplicatePuppetStates = {
3800
+ Fire = NOOP,
3801
+ FireAll = NOOP,
3802
+ FireList = NOOP,
3803
+ FireExcept = NOOP
3804
+ },
3805
+ DestroyPuppet = {
3806
+ Fire = NOOP,
3807
+ FireAll = NOOP,
3808
+ FireList = NOOP,
3809
+ FireExcept = NOOP
3810
+ },
3811
+ CreateDirtyGroupsFromClient = {
3812
+ On = NOOP
3813
+ },
3814
+ CreateDirtyGroupsFromServer = {
3815
+ Fire = NOOP,
3816
+ FireAll = NOOP,
3817
+ FireList = NOOP,
3818
+ FireExcept = NOOP
3819
+ },
3820
+ ReplicateState = {
3821
+ Fire = NOOP,
3822
+ FireAll = NOOP,
3823
+ FireList = NOOP,
3824
+ FireExcept = NOOP
3825
+ },
3826
+ ReplicateDestruction = {
3827
+ Fire = NOOP,
3828
+ FireAll = NOOP,
3829
+ FireList = NOOP,
3830
+ FireExcept = NOOP
3831
+ },
3832
+ ClientInitComplete = {
3833
+ On = NOOP
3834
+ },
3835
+ SignalPrintState = {
3836
+ Fire = NOOP,
3837
+ FireAll = NOOP,
3838
+ FireList = NOOP,
3839
+ FireExcept = NOOP
3840
+ },
3841
+ },
3842
+ })
3843
+ return Returns :: BLINK_EVENTS_SYMBOL
3844
+ end
3845
+
3846
+ if not RunService:IsServer() then
3847
+ error("Server network module can only be required from the server.")
3848
+ end
3849
+
3850
+ local Reliable: RemoteEvent = ReplicatedStorage:FindFirstChild(BASE_EVENT_NAME .. "_RELIABLE_REMOTE") :: RemoteEvent
3851
+ if not Reliable then
3852
+ local RemoteEvent = Instance.new("RemoteEvent")
3853
+ RemoteEvent.Name = BASE_EVENT_NAME .. "_RELIABLE_REMOTE"
3854
+ RemoteEvent.Parent = ReplicatedStorage
3855
+ Reliable = RemoteEvent
3856
+ end
3857
+
3858
+ local Unreliable: UnreliableRemoteEvent = ReplicatedStorage:FindFirstChild(BASE_EVENT_NAME .. "_UNRELIABLE_REMOTE") :: UnreliableRemoteEvent
3859
+ if not Unreliable then
3860
+ local UnreliableRemoteEvent = Instance.new("UnreliableRemoteEvent")
3861
+ UnreliableRemoteEvent.Name = BASE_EVENT_NAME .. "_UNRELIABLE_REMOTE"
3862
+ UnreliableRemoteEvent.Parent = ReplicatedStorage
3863
+ Unreliable = UnreliableRemoteEvent
3864
+ end
3865
+
3866
+ local PlayersMap: {[Player]: BufferSave} = {}
3867
+
3868
+ Players.PlayerRemoving:Connect(function(Player)
3869
+ PlayersMap[Player] = nil
3870
+ end)
3871
+
3872
+ local function StepReplication()
3873
+ for Player, Send in PlayersMap do
3874
+ if Send.Cursor <= 0 then
3875
+ continue
3876
+ end
3877
+
3878
+ local Buffer = buffer.create(Send.Cursor)
3879
+ buffer.copy(Buffer, 0, Send.Buffer, 0, Send.Cursor)
3880
+ Reliable:FireClient(Player, Buffer, Send.Instances)
3881
+
3882
+ Send.Size = 64
3883
+ Send.Cursor = 0
3884
+ Send.Buffer = buffer.create(64)
3885
+ table.clear(Send.Instances)
3886
+ end
3887
+ end
3888
+ RunService.Heartbeat:Connect(StepReplication)
3889
+ Reliable.OnServerEvent:Connect(function(Player: Player, Buffer: buffer, Instances: {Instance})
3890
+ RecieveCursor = 0
3891
+ RecieveBuffer = Buffer
3892
+ RecieveInstances = Instances
3893
+ RecieveInstanceCursor = 0
3894
+ local Size = buffer.len(RecieveBuffer)
3895
+ while (RecieveCursor < Size) do
3896
+ -- Read BLOCK: 1 bytes
3897
+ local BLOCK_START = Read(1)
3898
+ local Index = buffer.readu8(RecieveBuffer, BLOCK_START + 0)
3899
+ if Index == 5 then
3900
+ local Value: {[string]: Part} = Shatterbox_ReadEVENT_CreateDirtyGroupsFromClient()
3901
+ if #Events.Reliable[5] > 0 then
3902
+ for _, Listener in Events.Reliable[5] do
3903
+ task.spawn(Listener, Player, Value)
3904
+ end
3905
+ else
3906
+ if #Queue.Reliable[5] > 256 then
3907
+ warn("[Blink]: Event queue of \"CreateDirtyGroupsFromClient\" exceeded 256, did you forget to implement a listener?")
3908
+ end
3909
+ table.insert(Queue.Reliable[5], {Player, Value} :: {any})
3910
+ end
3911
+ elseif Index == 9 then
3912
+ local Value: nil = Shatterbox_ReadEVENT_ClientInitComplete()
3913
+ if Events.Reliable[9] ~= nil then
3914
+ task.spawn(Events.Reliable[9], Player, Value)
3915
+ else
3916
+ if #Queue.Reliable[9] > 256 then
3917
+ warn("[Blink]: Event queue of \"ClientInitComplete\" exceeded 256, did you forget to implement a listener?")
3918
+ end
3919
+ table.insert(Queue.Reliable[9], {Player, Value} :: {any})
3920
+ end
3921
+ end
3922
+ end
3923
+ end)
3924
+ Unreliable.OnServerEvent:Connect(function(Player: Player, Buffer: buffer, Instances: {Instance})
3925
+ RecieveCursor = 0
3926
+ RecieveBuffer = Buffer
3927
+ RecieveInstances = Instances
3928
+ RecieveInstanceCursor = 0
3929
+ local Size = buffer.len(RecieveBuffer)
3930
+ while (RecieveCursor < Size) do
3931
+ -- Read BLOCK: 1 bytes
3932
+ local BLOCK_START = Read(1)
3933
+ local Index = buffer.readu8(RecieveBuffer, BLOCK_START + 0)
3934
+ end
3935
+ end)
3936
+
3937
+
3938
+ local Returns = table.freeze({
3939
+ StepReplication = StepReplication,
3940
+
3941
+ Shatterbox = {
3942
+ SignalClearQueue = {
3943
+ Fire = function(Player: Player, Value: nil): ()
3944
+ Load(PlayersMap[Player])
3945
+ Shatterbox_WriteEVENT_SignalClearQueue(Value)
3946
+ PlayersMap[Player] = Save()
3947
+ end,
3948
+ FireAll = function(Value: nil): ()
3949
+ Load()
3950
+ Shatterbox_WriteEVENT_SignalClearQueue(Value)
3951
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
3952
+ for _, Player in Players:GetPlayers() do
3953
+ Load(PlayersMap[Player])
3954
+ local Position = Allocate(Size)
3955
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
3956
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
3957
+ PlayersMap[Player] = Save()
3958
+ end
3959
+ end,
3960
+ FireList = function(List: {Player}, Value: nil): ()
3961
+ Load()
3962
+ Shatterbox_WriteEVENT_SignalClearQueue(Value)
3963
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
3964
+ for _, Player in List do
3965
+ Load(PlayersMap[Player])
3966
+ local Position = Allocate(Size)
3967
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
3968
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
3969
+ PlayersMap[Player] = Save()
3970
+ end
3971
+ end,
3972
+ FireExcept = function(Except: Player, Value: nil): ()
3973
+ Load()
3974
+ Shatterbox_WriteEVENT_SignalClearQueue(Value)
3975
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
3976
+ for _, Player in Players:GetPlayers() do
3977
+ if Player == Except then
3978
+ continue
3979
+ end
3980
+ Load(PlayersMap[Player])
3981
+ local Position = Allocate(Size)
3982
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
3983
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
3984
+ PlayersMap[Player] = Save()
3985
+ end
3986
+ end,
3987
+ },
3988
+ SignalReset = {
3989
+ Fire = function(Player: Player, Value: boolean): ()
3990
+ Load(PlayersMap[Player])
3991
+ Shatterbox_WriteEVENT_SignalReset(Value)
3992
+ PlayersMap[Player] = Save()
3993
+ end,
3994
+ FireAll = function(Value: boolean): ()
3995
+ Load()
3996
+ Shatterbox_WriteEVENT_SignalReset(Value)
3997
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
3998
+ for _, Player in Players:GetPlayers() do
3999
+ Load(PlayersMap[Player])
4000
+ local Position = Allocate(Size)
4001
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4002
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4003
+ PlayersMap[Player] = Save()
4004
+ end
4005
+ end,
4006
+ FireList = function(List: {Player}, Value: boolean): ()
4007
+ Load()
4008
+ Shatterbox_WriteEVENT_SignalReset(Value)
4009
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4010
+ for _, Player in List do
4011
+ Load(PlayersMap[Player])
4012
+ local Position = Allocate(Size)
4013
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4014
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4015
+ PlayersMap[Player] = Save()
4016
+ end
4017
+ end,
4018
+ FireExcept = function(Except: Player, Value: boolean): ()
4019
+ Load()
4020
+ Shatterbox_WriteEVENT_SignalReset(Value)
4021
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4022
+ for _, Player in Players:GetPlayers() do
4023
+ if Player == Except then
4024
+ continue
4025
+ end
4026
+ Load(PlayersMap[Player])
4027
+ local Position = Allocate(Size)
4028
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4029
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4030
+ PlayersMap[Player] = Save()
4031
+ end
4032
+ end,
4033
+ },
4034
+ SignalResetArea = {
4035
+ Fire = function(Player: Player, Value1: CFrame, Value2: Vector3): ()
4036
+ Load(PlayersMap[Player])
4037
+ Shatterbox_WriteEVENT_SignalResetArea(Value1, Value2)
4038
+ PlayersMap[Player] = Save()
4039
+ end,
4040
+ FireAll = function(Value1: CFrame, Value2: Vector3): ()
4041
+ Load()
4042
+ Shatterbox_WriteEVENT_SignalResetArea(Value1, Value2)
4043
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4044
+ for _, Player in Players:GetPlayers() do
4045
+ Load(PlayersMap[Player])
4046
+ local Position = Allocate(Size)
4047
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4048
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4049
+ PlayersMap[Player] = Save()
4050
+ end
4051
+ end,
4052
+ FireList = function(List: {Player}, Value1: CFrame, Value2: Vector3): ()
4053
+ Load()
4054
+ Shatterbox_WriteEVENT_SignalResetArea(Value1, Value2)
4055
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4056
+ for _, Player in List do
4057
+ Load(PlayersMap[Player])
4058
+ local Position = Allocate(Size)
4059
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4060
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4061
+ PlayersMap[Player] = Save()
4062
+ end
4063
+ end,
4064
+ FireExcept = function(Except: Player, Value1: CFrame, Value2: Vector3): ()
4065
+ Load()
4066
+ Shatterbox_WriteEVENT_SignalResetArea(Value1, Value2)
4067
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4068
+ for _, Player in Players:GetPlayers() do
4069
+ if Player == Except then
4070
+ continue
4071
+ end
4072
+ Load(PlayersMap[Player])
4073
+ local Position = Allocate(Size)
4074
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4075
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4076
+ PlayersMap[Player] = Save()
4077
+ end
4078
+ end,
4079
+ },
4080
+ CreatePuppets = {
4081
+ Fire = function(Player: Player, Value: { { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } } }): ()
4082
+ Load(PlayersMap[Player])
4083
+ Shatterbox_WriteEVENT_CreatePuppets(Value)
4084
+ PlayersMap[Player] = Save()
4085
+ end,
4086
+ FireAll = function(Value: { { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } } }): ()
4087
+ Load()
4088
+ Shatterbox_WriteEVENT_CreatePuppets(Value)
4089
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4090
+ for _, Player in Players:GetPlayers() do
4091
+ Load(PlayersMap[Player])
4092
+ local Position = Allocate(Size)
4093
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4094
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4095
+ PlayersMap[Player] = Save()
4096
+ end
4097
+ end,
4098
+ FireList = function(List: {Player}, Value: { { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } } }): ()
4099
+ Load()
4100
+ Shatterbox_WriteEVENT_CreatePuppets(Value)
4101
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4102
+ for _, Player in List do
4103
+ Load(PlayersMap[Player])
4104
+ local Position = Allocate(Size)
4105
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4106
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4107
+ PlayersMap[Player] = Save()
4108
+ end
4109
+ end,
4110
+ FireExcept = function(Except: Player, Value: { { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } } }): ()
4111
+ Load()
4112
+ Shatterbox_WriteEVENT_CreatePuppets(Value)
4113
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4114
+ for _, Player in Players:GetPlayers() do
4115
+ if Player == Except then
4116
+ continue
4117
+ end
4118
+ Load(PlayersMap[Player])
4119
+ local Position = Allocate(Size)
4120
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4121
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4122
+ PlayersMap[Player] = Save()
4123
+ end
4124
+ end,
4125
+ },
4126
+ ReplicatePuppetStates = {
4127
+ Fire = function(Player: Player, Value1: buffer, Value2: number): ()
4128
+ Load()
4129
+ Shatterbox_WriteEVENT_ReplicatePuppetStates(Value1, Value2)
4130
+ local Buffer = buffer.create(SendCursor)
4131
+ buffer.copy(Buffer, 0, SendBuffer, 0, SendCursor)
4132
+ Unreliable:FireClient(Player, Buffer, SendInstances)
4133
+ end,
4134
+ FireAll = function(Value1: buffer, Value2: number): ()
4135
+ Load()
4136
+ Shatterbox_WriteEVENT_ReplicatePuppetStates(Value1, Value2)
4137
+ local Buffer = buffer.create(SendCursor)
4138
+ buffer.copy(Buffer, 0, SendBuffer, 0, SendCursor)
4139
+ Unreliable:FireAllClients(Buffer, SendInstances)
4140
+ end,
4141
+ FireList = function(List: {Player}, Value1: buffer, Value2: number): ()
4142
+ Load()
4143
+ Shatterbox_WriteEVENT_ReplicatePuppetStates(Value1, Value2)
4144
+ local Buffer = buffer.create(SendCursor)
4145
+ buffer.copy(Buffer, 0, SendBuffer, 0, SendCursor)
4146
+ for _, Player in List do
4147
+ Unreliable:FireClient(Player, Buffer, SendInstances)
4148
+ end
4149
+ end,
4150
+ FireExcept = function(Except: Player, Value1: buffer, Value2: number): ()
4151
+ Load()
4152
+ Shatterbox_WriteEVENT_ReplicatePuppetStates(Value1, Value2)
4153
+ local Buffer = buffer.create(SendCursor)
4154
+ buffer.copy(Buffer, 0, SendBuffer, 0, SendCursor)
4155
+ for _, Player in Players:GetPlayers() do
4156
+ if Player == Except then
4157
+ continue
4158
+ end
4159
+ Unreliable:FireClient(Player, Buffer, SendInstances)
4160
+ end
4161
+ end,
4162
+ },
4163
+ DestroyPuppet = {
4164
+ Fire = function(Player: Player, Value: number): ()
4165
+ Load(PlayersMap[Player])
4166
+ Shatterbox_WriteEVENT_DestroyPuppet(Value)
4167
+ PlayersMap[Player] = Save()
4168
+ end,
4169
+ FireAll = function(Value: number): ()
4170
+ Load()
4171
+ Shatterbox_WriteEVENT_DestroyPuppet(Value)
4172
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4173
+ for _, Player in Players:GetPlayers() do
4174
+ Load(PlayersMap[Player])
4175
+ local Position = Allocate(Size)
4176
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4177
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4178
+ PlayersMap[Player] = Save()
4179
+ end
4180
+ end,
4181
+ FireList = function(List: {Player}, Value: number): ()
4182
+ Load()
4183
+ Shatterbox_WriteEVENT_DestroyPuppet(Value)
4184
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4185
+ for _, Player in List do
4186
+ Load(PlayersMap[Player])
4187
+ local Position = Allocate(Size)
4188
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4189
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4190
+ PlayersMap[Player] = Save()
4191
+ end
4192
+ end,
4193
+ FireExcept = function(Except: Player, Value: number): ()
4194
+ Load()
4195
+ Shatterbox_WriteEVENT_DestroyPuppet(Value)
4196
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4197
+ for _, Player in Players:GetPlayers() do
4198
+ if Player == Except then
4199
+ continue
4200
+ end
4201
+ Load(PlayersMap[Player])
4202
+ local Position = Allocate(Size)
4203
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4204
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4205
+ PlayersMap[Player] = Save()
4206
+ end
4207
+ end,
4208
+ },
4209
+ CreateDirtyGroupsFromClient = {
4210
+ On = function(Listener: (Player: Player, Value: {[string]: Part}) -> ()): () -> ()
4211
+ table.insert(Events.Reliable[5], Listener)
4212
+ for Index, Arguments in Queue.Reliable[5] do
4213
+ task.spawn(Listener, table.unpack(Arguments))
4214
+ end
4215
+ Queue.Reliable[5] = {}
4216
+ return function (): ()
4217
+ local Index = table.find(Events.Reliable[5], Listener)
4218
+ if Index ~= nil then
4219
+ table.remove(Events.Reliable[5], Index)
4220
+ end
4221
+ end
4222
+ end
4223
+ },
4224
+ CreateDirtyGroupsFromServer = {
4225
+ Fire = function(Player: Player, Value: {[string]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}): ()
4226
+ Load(PlayersMap[Player])
4227
+ Shatterbox_WriteEVENT_CreateDirtyGroupsFromServer(Value)
4228
+ PlayersMap[Player] = Save()
4229
+ end,
4230
+ FireAll = function(Value: {[string]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}): ()
4231
+ Load()
4232
+ Shatterbox_WriteEVENT_CreateDirtyGroupsFromServer(Value)
4233
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4234
+ for _, Player in Players:GetPlayers() do
4235
+ Load(PlayersMap[Player])
4236
+ local Position = Allocate(Size)
4237
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4238
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4239
+ PlayersMap[Player] = Save()
4240
+ end
4241
+ end,
4242
+ FireList = function(List: {Player}, Value: {[string]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}): ()
4243
+ Load()
4244
+ Shatterbox_WriteEVENT_CreateDirtyGroupsFromServer(Value)
4245
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4246
+ for _, Player in List do
4247
+ Load(PlayersMap[Player])
4248
+ local Position = Allocate(Size)
4249
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4250
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4251
+ PlayersMap[Player] = Save()
4252
+ end
4253
+ end,
4254
+ FireExcept = function(Except: Player, Value: {[string]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}): ()
4255
+ Load()
4256
+ Shatterbox_WriteEVENT_CreateDirtyGroupsFromServer(Value)
4257
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4258
+ for _, Player in Players:GetPlayers() do
4259
+ if Player == Except then
4260
+ continue
4261
+ end
4262
+ Load(PlayersMap[Player])
4263
+ local Position = Allocate(Size)
4264
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4265
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4266
+ PlayersMap[Player] = Save()
4267
+ end
4268
+ end,
4269
+ },
4270
+ ReplicateState = {
4271
+ Fire = function(Player: Player, Value1: {[string]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}, Value2: {[string]: { { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } } }}, Value3: {[string]: boolean}, Value4: { { ID: string, CuttingPart: { CFrame: CFrame, Size: Vector3, Shape: number }, FilterTagged: { string }?, GridSize: number?, CleanupDelay: number?, SkipWalls: boolean?, SkipFloors: boolean?, SkipEncapsulatedVoxels: boolean?, OnVoxelDestruct: string?, UserData: any? } }, Value5: {[string]: number}, Value6: {[string]: {[string]: boolean}}, Value7: {[string]: number}, Value8: {[string]: number}, Value9: {[string]: number}, Value10: {[number]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}, Value11: number): ()
4272
+ Load(PlayersMap[Player])
4273
+ Shatterbox_WriteEVENT_ReplicateState(Value1, Value2, Value3, Value4, Value5, Value6, Value7, Value8, Value9, Value10, Value11)
4274
+ PlayersMap[Player] = Save()
4275
+ end,
4276
+ FireAll = function(Value1: {[string]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}, Value2: {[string]: { { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } } }}, Value3: {[string]: boolean}, Value4: { { ID: string, CuttingPart: { CFrame: CFrame, Size: Vector3, Shape: number }, FilterTagged: { string }?, GridSize: number?, CleanupDelay: number?, SkipWalls: boolean?, SkipFloors: boolean?, SkipEncapsulatedVoxels: boolean?, OnVoxelDestruct: string?, UserData: any? } }, Value5: {[string]: number}, Value6: {[string]: {[string]: boolean}}, Value7: {[string]: number}, Value8: {[string]: number}, Value9: {[string]: number}, Value10: {[number]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}, Value11: number): ()
4277
+ Load()
4278
+ Shatterbox_WriteEVENT_ReplicateState(Value1, Value2, Value3, Value4, Value5, Value6, Value7, Value8, Value9, Value10, Value11)
4279
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4280
+ for _, Player in Players:GetPlayers() do
4281
+ Load(PlayersMap[Player])
4282
+ local Position = Allocate(Size)
4283
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4284
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4285
+ PlayersMap[Player] = Save()
4286
+ end
4287
+ end,
4288
+ FireList = function(List: {Player}, Value1: {[string]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}, Value2: {[string]: { { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } } }}, Value3: {[string]: boolean}, Value4: { { ID: string, CuttingPart: { CFrame: CFrame, Size: Vector3, Shape: number }, FilterTagged: { string }?, GridSize: number?, CleanupDelay: number?, SkipWalls: boolean?, SkipFloors: boolean?, SkipEncapsulatedVoxels: boolean?, OnVoxelDestruct: string?, UserData: any? } }, Value5: {[string]: number}, Value6: {[string]: {[string]: boolean}}, Value7: {[string]: number}, Value8: {[string]: number}, Value9: {[string]: number}, Value10: {[number]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}, Value11: number): ()
4289
+ Load()
4290
+ Shatterbox_WriteEVENT_ReplicateState(Value1, Value2, Value3, Value4, Value5, Value6, Value7, Value8, Value9, Value10, Value11)
4291
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4292
+ for _, Player in List do
4293
+ Load(PlayersMap[Player])
4294
+ local Position = Allocate(Size)
4295
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4296
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4297
+ PlayersMap[Player] = Save()
4298
+ end
4299
+ end,
4300
+ FireExcept = function(Except: Player, Value1: {[string]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}, Value2: {[string]: { { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } } }}, Value3: {[string]: boolean}, Value4: { { ID: string, CuttingPart: { CFrame: CFrame, Size: Vector3, Shape: number }, FilterTagged: { string }?, GridSize: number?, CleanupDelay: number?, SkipWalls: boolean?, SkipFloors: boolean?, SkipEncapsulatedVoxels: boolean?, OnVoxelDestruct: string?, UserData: any? } }, Value5: {[string]: number}, Value6: {[string]: {[string]: boolean}}, Value7: {[string]: number}, Value8: {[string]: number}, Value9: {[string]: number}, Value10: {[number]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}, Value11: number): ()
4301
+ Load()
4302
+ Shatterbox_WriteEVENT_ReplicateState(Value1, Value2, Value3, Value4, Value5, Value6, Value7, Value8, Value9, Value10, Value11)
4303
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4304
+ for _, Player in Players:GetPlayers() do
4305
+ if Player == Except then
4306
+ continue
4307
+ end
4308
+ Load(PlayersMap[Player])
4309
+ local Position = Allocate(Size)
4310
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4311
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4312
+ PlayersMap[Player] = Save()
4313
+ end
4314
+ end,
4315
+ },
4316
+ ReplicateDestruction = {
4317
+ Fire = function(Player: Player, Value1: string, Value2: { ID: string, CuttingPart: { CFrame: CFrame, Size: Vector3, Shape: number }, FilterTagged: { string }?, GridSize: number?, CleanupDelay: number?, SkipWalls: boolean?, SkipFloors: boolean?, SkipEncapsulatedVoxels: boolean?, OnVoxelDestruct: string?, UserData: any? }, Value3: {[string]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}, Value4: {[string]: boolean}?): ()
4318
+ Load(PlayersMap[Player])
4319
+ Shatterbox_WriteEVENT_ReplicateDestruction(Value1, Value2, Value3, Value4)
4320
+ PlayersMap[Player] = Save()
4321
+ end,
4322
+ FireAll = function(Value1: string, Value2: { ID: string, CuttingPart: { CFrame: CFrame, Size: Vector3, Shape: number }, FilterTagged: { string }?, GridSize: number?, CleanupDelay: number?, SkipWalls: boolean?, SkipFloors: boolean?, SkipEncapsulatedVoxels: boolean?, OnVoxelDestruct: string?, UserData: any? }, Value3: {[string]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}, Value4: {[string]: boolean}?): ()
4323
+ Load()
4324
+ Shatterbox_WriteEVENT_ReplicateDestruction(Value1, Value2, Value3, Value4)
4325
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4326
+ for _, Player in Players:GetPlayers() do
4327
+ Load(PlayersMap[Player])
4328
+ local Position = Allocate(Size)
4329
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4330
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4331
+ PlayersMap[Player] = Save()
4332
+ end
4333
+ end,
4334
+ FireList = function(List: {Player}, Value1: string, Value2: { ID: string, CuttingPart: { CFrame: CFrame, Size: Vector3, Shape: number }, FilterTagged: { string }?, GridSize: number?, CleanupDelay: number?, SkipWalls: boolean?, SkipFloors: boolean?, SkipEncapsulatedVoxels: boolean?, OnVoxelDestruct: string?, UserData: any? }, Value3: {[string]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}, Value4: {[string]: boolean}?): ()
4335
+ Load()
4336
+ Shatterbox_WriteEVENT_ReplicateDestruction(Value1, Value2, Value3, Value4)
4337
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4338
+ for _, Player in List do
4339
+ Load(PlayersMap[Player])
4340
+ local Position = Allocate(Size)
4341
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4342
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4343
+ PlayersMap[Player] = Save()
4344
+ end
4345
+ end,
4346
+ FireExcept = function(Except: Player, Value1: string, Value2: { ID: string, CuttingPart: { CFrame: CFrame, Size: Vector3, Shape: number }, FilterTagged: { string }?, GridSize: number?, CleanupDelay: number?, SkipWalls: boolean?, SkipFloors: boolean?, SkipEncapsulatedVoxels: boolean?, OnVoxelDestruct: string?, UserData: any? }, Value3: {[string]: { CFrame: CFrame, Size: Vector3, Anchored: boolean, Color: Color3?, Material: number?, Transparency: number?, Reflectance: number?, MaterialVariant: string?, CollisionGroup: string?, LeftSurface: number?, RightSurface: number?, FrontSurface: number?, BackSurface: number?, TopSurface: number?, BottomSurface: number?, Textures: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number?, OffsetStudsU: number?, OffsetStudsV: number?, StudsPerTileU: number?, StudsPerTileV: number? } }?, Lights: { { ClassName: string, Brightness: number?, Color: Color3?, Shadows: boolean?, Range: number?, Angle: number?, Face: number? } }?, Decals: { { Color3: Color3?, ColorMap: string?, Transparency: number?, UVOffset: { number }?, UVScale: { number }?, ZIndex: number?, Face: number? } }?, Attributes: {[string]: any}, Tags: { string } }}, Value4: {[string]: boolean}?): ()
4347
+ Load()
4348
+ Shatterbox_WriteEVENT_ReplicateDestruction(Value1, Value2, Value3, Value4)
4349
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4350
+ for _, Player in Players:GetPlayers() do
4351
+ if Player == Except then
4352
+ continue
4353
+ end
4354
+ Load(PlayersMap[Player])
4355
+ local Position = Allocate(Size)
4356
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4357
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4358
+ PlayersMap[Player] = Save()
4359
+ end
4360
+ end,
4361
+ },
4362
+ ClientInitComplete = {
4363
+ On = function(Listener: (Player: Player, Value: nil) -> ()): () -> ()
4364
+ Events.Reliable[9] = Listener
4365
+ for Index, Arguments in Queue.Reliable[9] do
4366
+ task.spawn(Listener, table.unpack(Arguments))
4367
+ end
4368
+ Queue.Reliable[9] = {}
4369
+ return function (): ()
4370
+ if Events.Reliable[9] == Listener then
4371
+ Events.Reliable[9] = nil
4372
+ end
4373
+ end
4374
+ end
4375
+ },
4376
+ SignalPrintState = {
4377
+ Fire = function(Player: Player, Value: nil): ()
4378
+ Load(PlayersMap[Player])
4379
+ Shatterbox_WriteEVENT_SignalPrintState(Value)
4380
+ PlayersMap[Player] = Save()
4381
+ end,
4382
+ FireAll = function(Value: nil): ()
4383
+ Load()
4384
+ Shatterbox_WriteEVENT_SignalPrintState(Value)
4385
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4386
+ for _, Player in Players:GetPlayers() do
4387
+ Load(PlayersMap[Player])
4388
+ local Position = Allocate(Size)
4389
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4390
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4391
+ PlayersMap[Player] = Save()
4392
+ end
4393
+ end,
4394
+ FireList = function(List: {Player}, Value: nil): ()
4395
+ Load()
4396
+ Shatterbox_WriteEVENT_SignalPrintState(Value)
4397
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4398
+ for _, Player in List do
4399
+ Load(PlayersMap[Player])
4400
+ local Position = Allocate(Size)
4401
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4402
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4403
+ PlayersMap[Player] = Save()
4404
+ end
4405
+ end,
4406
+ FireExcept = function(Except: Player, Value: nil): ()
4407
+ Load()
4408
+ Shatterbox_WriteEVENT_SignalPrintState(Value)
4409
+ local Buffer, Size, Instances = SendBuffer, SendCursor, SendInstances
4410
+ for _, Player in Players:GetPlayers() do
4411
+ if Player == Except then
4412
+ continue
4413
+ end
4414
+ Load(PlayersMap[Player])
4415
+ local Position = Allocate(Size)
4416
+ buffer.copy(SendBuffer, Position, Buffer, 0, Size)
4417
+ table.move(Instances, 1, #Instances, #SendInstances + 1, SendInstances)
4418
+ PlayersMap[Player] = Save()
4419
+ end
4420
+ end,
4421
+ },
4422
+ },
4423
+ })
4424
+ type BLINK_EVENTS_SYMBOL = typeof(Returns)
4425
+ return Returns :: BLINK_EVENTS_SYMBOL