PraiseLeakedMan

Untitled

Oct 15th, 2020
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. local partsWithId = {}
  2. local awaitRef = {}
  3.  
  4. local root = {
  5. ID = 0;
  6. Type = "TextButton";
  7. Properties = {
  8. TextWrapped = true;
  9. TextColor3 = Color3.new(241/255,1,50/51);
  10. Text = "Open";
  11. Size = UDim2.new(0,269,0,100);
  12. Font = Enum.Font.SciFi;
  13. Name = "Open";
  14. FontSize = Enum.FontSize.Size14;
  15. TextSize = 14;
  16. BackgroundColor3 = Color3.new(0,0,0);
  17. TextScaled = true;
  18. TextWrap = true;
  19. };
  20. Children = {};
  21. };
  22.  
  23. local function Scan(item, parent)
  24. local obj = Instance.new(item.Type)
  25. if (item.ID) then
  26. local awaiting = awaitRef[item.ID]
  27. if (awaiting) then
  28. awaiting[1][awaiting[2]] = obj
  29. awaitRef[item.ID] = nil
  30. else
  31. partsWithId[item.ID] = obj
  32. end
  33. end
  34. for p,v in pairs(item.Properties) do
  35. if (type(v) == "string") then
  36. local id = tonumber(v:match("^_R:(%w+)_$"))
  37. if (id) then
  38. if (partsWithId[id]) then
  39. v = partsWithId[id]
  40. else
  41. awaitRef[id] = {obj, p}
  42. v = nil
  43. end
  44. end
  45. end
  46. obj[p] = v
  47. end
  48. for _,c in pairs(item.Children) do
  49. Scan(c, obj)
  50. end
  51. obj.Parent = parent
  52. return obj
  53. end
  54.  
  55. return function() return Scan(root, nil) end
Advertisement
Add Comment
Please, Sign In to add comment