From 1ad471c2e4b4f61e8127ca45b68d947fbb18a4f1 Mon Sep 17 00:00:00 2001 From: Jacob I <24721341+jisham318@users.noreply.github.com> Date: Sat, 25 Nov 2023 16:46:39 -0600 Subject: [PATCH] Add default ser methods for Vector3 and Color3 --- modules/ser/init.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/ser/init.lua b/modules/ser/init.lua index 3420d440..06d6f2aa 100644 --- a/modules/ser/init.lua +++ b/modules/ser/init.lua @@ -75,6 +75,22 @@ Ser.Classes = { end, Deserialize = Option.Deserialize, }, + Vector3 = { + Serialize = function(v3 : Vector3) + return { ClassName = "Vector3", Value = {X = v3.X, Y = v3.Y, Z = v3.Z} } + end, + Deserialize = function(tbl : {ClassName : string, Value : {X : number, Y : number, Z : number}}) + return Vector3.new(tbl.Value.X, tbl.Value.Y, tbl.Value.Z) + end + }, + Color3 = { + Serialize = function(c3 : Color3) + return { ClassName = "Color3", Value = c3:ToHex() } + end, + Deserialize = function(tbl : {ClassName : string, Value : string}) + return Color3.fromHex(tbl.Value) + end + } } --[=[