Advertisement
Guest User

Deobfuscated Source

a guest
Sep 25th, 2023
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.16 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3.  
  4. local function Serialize(...: BasePart)
  5.     assert(Players.LocalPlayer)
  6.  
  7.     local Arguments = { ... }
  8.  
  9.     local Result = ""
  10.  
  11.     for Index, Part in Arguments do
  12.         if Index > 1 then
  13.             Result ..= "<seperator>"
  14.         end
  15.  
  16.         local Origin = CFrame.new(Part.Position)
  17.             * CFrame.fromOrientation(
  18.                 math.rad(Part.Orientation.X),
  19.                 math.rad(Part.Orientation.Y),
  20.                 math.rad(Part.Orientation.Z)
  21.             )
  22.         local Matrices = { Origin:GetComponents() }
  23.  
  24.         for Index, Point in Matrices do
  25.             if Point < 0 then
  26.                 Result ..= "<negative>"
  27.             end
  28.  
  29.             Result ..= math.abs(Point)
  30.  
  31.             if typeof(Index) == "number" and Index < #Matrices then
  32.                 Result ..= "<end>"
  33.             end
  34.         end
  35.     end
  36.  
  37.     return Result
  38. end
  39.  
  40. local function Deserialize(Serialized: string)
  41.     local Result = {}
  42.     Serialized = Serialized:gsub("<negative>", "-")
  43.     local Separated = Serialized:split("<seperator>")
  44.  
  45.     for Index, Value in Separated do
  46.         Result[Index] = CFrame.new(table.unpack(Value:split("<end>")))
  47.     end
  48.  
  49.     return table.unpack(Result)
  50. end
  51.  
  52. return RunService:IsClient() and Serialize or Deserialize
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement