Josiahiscool73

m2s

Oct 15th, 2026 (edited)
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.85 KB | None | 0 0
  1. -- this updates https://www.roblox.com/users/6911602/profile ttyyuu12345s old method so credit goes to him but the old one split the model into chunks but theres newer way that lets you bypass roblox character limit so this just uses that and its made with chatgpt so that why ui is built into it and looks worser than og
  2. lightingPropertes = {
  3. "Ambient",
  4. "Brightness",
  5. "ColorShift_Bottom",
  6. "ColorShift_Top",
  7. "GlobalShadows",
  8. "OutdoorAmbient",
  9. "Outlines",
  10. "GeographicLatitude",
  11. "TimeOfDay",
  12. "FogColor",
  13. "FogEnd",
  14. "FogStart",
  15. }
  16. supportedClasses = {
  17. ["Accoutrement"] = true,
  18. ["Accessory"] = true,
  19. ["Hat"] = true,
  20. ["Animation"] = true,
  21. ["AnimationController"] = true,
  22. ["Beam"] = true,
  23. ["BindableEvent"] = true,
  24. ["BindableFunction"] = true,
  25. ["BodyAngularVelocity"] = true,
  26. ["BodyForce"] = true,
  27. ["BodyGyro"] = true,
  28. ["BodyPosition"] = true,
  29. ["BodyThrust"] = true,
  30. ["BodyVelocity"] = true,
  31. ["RocketPropulsion"] = true,
  32. ["Camera"] = true,
  33. ["BodyColors"] = true,
  34. ["CharacterMesh"] = true,
  35. ["Pants"] = true,
  36. ["Shirt"] = true,
  37. ["ShirtGraphic"] = true,
  38. ["Skin"] = true,
  39. ["ClickDetector"] = true,
  40. ["Configuration"] = true,
  41. ["AlignOrientation"] = true,
  42. ["AlignPosition"] = true,
  43. ["BallSocketConstraint"] = true,
  44. ["HingeConstraint"] = true,
  45. ["LineForce"] = true,
  46. ["RodConstraint"] = true,
  47. ["RopeConstraint"] = true,
  48. ["CylindricalConstraint"] = true,
  49. ["PrismaticConstraint"] = true,
  50. ["SpringConstraint"] = true,
  51. ["Torque"] = true,
  52. ["VectorForce"] = true,
  53. ["HumanoidController"] = true,
  54. ["SkateboardController"] = true,
  55. ["VehicleController"] = true,
  56. ["CustomEvent"] = true,
  57. ["CustomEventReceiver"] = true,
  58. ["BlockMesh"] = true,
  59. ["CylinderMesh"] = true,
  60. ["FileMesh"] = true,
  61. ["SpecialMesh"] = true,
  62. ["Dialog"] = true,
  63. ["DialogChoice"] = true,
  64. ["Explosion"] = true,
  65. ["Decal"] = true,
  66. ["Texture"] = true,
  67. ["Hole"] = true,
  68. ["MotorFeature"] = true,
  69. ["Fire"] = true,
  70. ["FlyweightService"] = true,
  71. ["CSGDictionaryService"] = true,
  72. ["NonReplicatedCSGDictionaryService"] = true,
  73. ["Folder"] = true,
  74. ["ForceField"] = true,
  75. ["FunctionalTest"] = true,
  76. ["Frame"] = true,
  77. ["ImageButton"] = true,
  78. ["TextButton"] = true,
  79. ["ImageLabel"] = true,
  80. ["TextLabel"] = true,
  81. ["ScrollingFrame"] = true,
  82. ["TextBox"] = true,
  83. ["BillboardGui"] = true,
  84. ["ScreenGui"] = true,
  85. ["GuiMain"] = true,
  86. ["SurfaceGui"] = true,
  87. ["FloorWire"] = true,
  88. ["BoxHandleAdornment"] = true,
  89. ["ConeHandleAdornment"] = true,
  90. ["CylinderHandleAdornment"] = true,
  91. ["ImageHandleAdornment"] = true,
  92. ["LineHandleAdornment"] = true,
  93. ["SphereHandleAdornment"] = true,
  94. ["SelectionBox"] = true,
  95. ["SelectionSphere"] = true,
  96. ["ArcHandles"] = true,
  97. ["Handles"] = true,
  98. ["SurfaceSelection"] = true,
  99. ["SelectionPartLasso"] = true,
  100. ["SelectionPointLasso"] = true,
  101. ["Backpack"] = true,
  102. ["HopperBin"] = true,
  103. ["Tool"] = true,
  104. ["Flag"] = true,
  105. ["Humanoid"] = true,
  106. ["RotateP"] = true,
  107. ["RotateV"] = true,
  108. ["Glue"] = true,
  109. ["ManualGlue"] = true,
  110. ["ManualWeld"] = true,
  111. ["Motor"] = true,
  112. ["Motor6D"] = true,
  113. ["Rotate"] = true,
  114. ["Snap"] = true,
  115. ["VelocityMotor"] = true,
  116. ["Weld"] = true,
  117. ["Keyframe"] = true,
  118. ["KeyframeSequence"] = true,
  119. ["PointLight"] = true,
  120. ["SpotLight"] = true,
  121. ["SurfaceLight"] = true,
  122. ["LocalizationTable"] = true,
  123. ["Script"] = true,
  124. ["LocalScript"] = true,
  125. ["ModuleScript"] = true,
  126. ["Message"] = true,
  127. ["Hint"] = true,
  128. ["CornerWedgePart"] = true,
  129. ["Part"] = true,
  130. ["FlagStand"] = true,
  131. ["Seat"] = true,
  132. ["SkateboardPlatform"] = true,
  133. ["SpawnLocation"] = true,
  134. ["WedgePart"] = true,
  135. ["MeshPart"] = true,
  136. ["PartOperation"] = true,
  137. ["NegateOperation"] = true,
  138. ["UnionOperation"] = true,
  139. ["TrussPart"] = true,
  140. ["VehicleSeat"] = true,
  141. ["Model"] = true,
  142. ["PartOperationAsset"] = true,
  143. ["ParticleEmitter"] = true,
  144. ["PluginAction"] = true,
  145. ["Pose"] = true,
  146. ["BloomEffect"] = true,
  147. ["BlurEffect"] = true,
  148. ["ColorCorrectionEffect"] = true,
  149. ["SunRaysEffect"] = true,
  150. ["ReflectionMetadata"] = true,
  151. ["ReflectionMetadataCallbacks"] = true,
  152. ["ReflectionMetadataClasses"] = true,
  153. ["ReflectionMetadataEnums"] = true,
  154. ["ReflectionMetadataEvents"] = true,
  155. ["ReflectionMetadataFunctions"] = true,
  156. ["ReflectionMetadataClass"] = true,
  157. ["ReflectionMetadataEnum"] = true,
  158. ["ReflectionMetadataEnumItem"] = true,
  159. ["ReflectionMetadataMember"] = true,
  160. ["ReflectionMetadataProperties"] = true,
  161. ["ReflectionMetadataYieldFunctions"] = true,
  162. ["RemoteEvent"] = true,
  163. ["RemoteFunction"] = true,
  164. ["Sky"] = true,
  165. ["Smoke"] = true,
  166. ["Sound"] = true,
  167. ["ChorusSoundEffect"] = true,
  168. ["CompressorSoundEffect"] = true,
  169. ["DistortionSoundEffect"] = true,
  170. ["EchoSoundEffect"] = true,
  171. ["EqualizerSoundEffect"] = true,
  172. ["FlangeSoundEffect"] = true,
  173. ["PitchShiftSoundEffect"] = true,
  174. ["ReverbSoundEffect"] = true,
  175. ["TremoloSoundEffect"] = true,
  176. ["SoundGroup"] = true,
  177. ["Sparkles"] = true,
  178. ["StarterGear"] = true,
  179. ["StarterPlayerScripts"] = true,
  180. ["StarterCharacterScripts"] = true,
  181. ["Team"] = true,
  182. ["TerrainRegion"] = true,
  183. ["TestService"] = true,
  184. ["Trail"] = true,
  185. ["Tween"] = true,
  186. ["UIAspectRatioConstraint"] = true,
  187. ["UISizeConstraint"] = true,
  188. ["UITextSizeConstraint"] = true,
  189. ["UIGridLayout"] = true,
  190. ["UIListLayout"] = true,
  191. ["UIPageLayout"] = true,
  192. ["UITableLayout"] = true,
  193. ["UIPadding"] = true,
  194. ["UIScale"] = true,
  195. ["BinaryStringValue"] = true,
  196. ["BoolValue"] = true,
  197. ["BrickColorValue"] = true,
  198. ["CFrameValue"] = true,
  199. ["Color3Value"] = true,
  200. ["DoubleConstrainedValue"] = true,
  201. ["IntConstrainedValue"] = true,
  202. ["IntValue"] = true,
  203. ["NumberValue"] = true,
  204. ["ObjectValue"] = true,
  205. ["RayValue"] = true,
  206. ["StringValue"] = true,
  207. ["Vector3Value"] = true,
  208. ["VirtualInputManager"] = true,
  209. ["WeldConstraint"] = true,
  210. }
  211. supportedProperties = {
  212. "Archivable",
  213. "ClassName",
  214. "DataCost",
  215. "Name",
  216. "Parent",
  217. "RobloxLocked",
  218. "archivable",
  219. "className",
  220. "AttachmentForward",
  221. "AttachmentPoint",
  222. "AttachmentPos",
  223. "AttachmentRight",
  224. "AttachmentUp",
  225. "AnimationId",
  226. "Animation",
  227. "IsPlaying",
  228. "Length",
  229. "Looped",
  230. "Priority",
  231. "Speed",
  232. "TimePosition",
  233. "WeightCurrent",
  234. "WeightTarget",
  235. "Axis",
  236. "CFrame",
  237. "Orientation",
  238. "Position",
  239. "Rotation",
  240. "SecondaryAxis",
  241. "Visible",
  242. "WorldAxis",
  243. "WorldCFrame",
  244. "WorldOrientation",
  245. "WorldPosition",
  246. "WorldRotation",
  247. "WorldSecondaryAxis",
  248. "SelectionImageObject",
  249. "Version",
  250. "CurrentScreenOrientation",
  251. "ScreenOrientation",
  252. "ProcessUserInput",
  253. "ResetPlayerGuiOnSpawn",
  254. "ShowDevelopmentGui",
  255. "Attachment0",
  256. "Attachment1",
  257. "Color",
  258. "CurveSize0",
  259. "CurveSize1",
  260. "Enabled",
  261. "FaceCamera",
  262. "LightEmission",
  263. "LightInfluence",
  264. "Segments",
  265. "Texture",
  266. "TextureLength",
  267. "TextureMode",
  268. "TextureSpeed",
  269. "Transparency",
  270. "Width0",
  271. "Width1",
  272. "ZOffset",
  273. "AngularVelocity",
  274. "MaxTorque",
  275. "P",
  276. "angularvelocity",
  277. "maxTorque",
  278. "Force",
  279. "force",
  280. "D",
  281. "cframe",
  282. "MaxForce",
  283. "maxForce",
  284. "position",
  285. "Location",
  286. "location",
  287. "Velocity",
  288. "velocity",
  289. "CartoonFactor",
  290. "MaxSpeed",
  291. "MaxThrust",
  292. "Target",
  293. "TargetOffset",
  294. "TargetRadius",
  295. "ThrustD",
  296. "ThrustP",
  297. "TurnD",
  298. "TurnP",
  299. "ClickableWhenViewportHidden",
  300. "Icon",
  301. "CameraSubject",
  302. "CameraType",
  303. "CoordinateFrame",
  304. "FieldOfView",
  305. "Focus",
  306. "HeadLocked",
  307. "HeadScale",
  308. "NearPlaneZ",
  309. "ViewportSize",
  310. "focus",
  311. "HeadColor",
  312. "HeadColor3",
  313. "LeftArmColor",
  314. "LeftArmColor3",
  315. "LeftLegColor",
  316. "LeftLegColor3",
  317. "RightArmColor",
  318. "RightArmColor3",
  319. "RightLegColor",
  320. "RightLegColor3",
  321. "TorsoColor",
  322. "TorsoColor3",
  323. "BaseTextureId",
  324. "BodyPart",
  325. "MeshId",
  326. "OverlayTextureId",
  327. "PantsTemplate",
  328. "ShirtTemplate",
  329. "Graphic",
  330. "SkinColor",
  331. "LoadDefaultChat",
  332. "CursorIcon",
  333. "MaxActivationDistance",
  334. "MaxAngularVelocity",
  335. "PrimaryAxisOnly",
  336. "ReactionTorqueEnabled",
  337. "Responsiveness",
  338. "RigidityEnabled",
  339. "ApplyAtCenterOfMass",
  340. "MaxVelocity",
  341. "ReactionForceEnabled",
  342. "LimitsEnabled",
  343. "Radius",
  344. "Restitution",
  345. "TwistLimitsEnabled",
  346. "TwistLowerAngle",
  347. "TwistUpperAngle",
  348. "UpperAngle",
  349. "ActuatorType",
  350. "AngularSpeed",
  351. "CurrentAngle",
  352. "LowerAngle",
  353. "MotorMaxAcceleration",
  354. "MotorMaxTorque",
  355. "ServoMaxTorque",
  356. "TargetAngle",
  357. "InverseSquareLaw",
  358. "Magnitude",
  359. "CurrentDistance",
  360. "Thickness",
  361. "CurrentPosition",
  362. "LowerLimit",
  363. "MotorMaxForce",
  364. "ServoMaxForce",
  365. "Size",
  366. "TargetPosition",
  367. "UpperLimit",
  368. "AngularActuatorType",
  369. "AngularLimitsEnabled",
  370. "AngularRestitution",
  371. "InclinationAngle",
  372. "MotorMaxAngularAcceleration",
  373. "RotationAxisVisible",
  374. "WorldRotationAxis",
  375. "Coils",
  376. "CurrentLength",
  377. "Damping",
  378. "FreeLength",
  379. "MaxLength",
  380. "MinLength",
  381. "Stiffness",
  382. "RelativeTo",
  383. "Torque",
  384. "BaseUrl",
  385. "RequestQueueSize",
  386. "Steer",
  387. "Throttle",
  388. "Source",
  389. "Offset",
  390. "Scale",
  391. "VertexColor",
  392. "TextureId",
  393. "MeshType",
  394. "AutomaticRetry",
  395. "LegacyNamingScheme",
  396. "MaxItems",
  397. "DataModel",
  398. "ErrorReporting",
  399. "GfxCard",
  400. "InstanceCount",
  401. "IsFmodProfilingEnabled",
  402. "IsScriptStackTracingEnabled",
  403. "JobCount",
  404. "LuaRamLimit",
  405. "OsIs64Bit",
  406. "OsPlatform",
  407. "OsPlatformId",
  408. "OsVer",
  409. "PlayerCount",
  410. "ReportSoundWarnings",
  411. "RobloxProductName",
  412. "RobloxVersion",
  413. "SIMD",
  414. "SystemProductName",
  415. "TickCountPreciseOverride",
  416. "VideoMemory",
  417. "Condition",
  418. "IsEnabled",
  419. "Line",
  420. "DebuggingEnabled",
  421. "Expression",
  422. "BehaviorType",
  423. "ConversationDistance",
  424. "GoodbyeChoiceActive",
  425. "GoodbyeDialog",
  426. "InUse",
  427. "InitialPrompt",
  428. "Purpose",
  429. "Tone",
  430. "TriggerDistance",
  431. "TriggerOffset",
  432. "ResponseDialog",
  433. "UserDialog",
  434. "BlastPressure",
  435. "BlastRadius",
  436. "DestroyJointRadiusPercent",
  437. "ExplosionType",
  438. "Face",
  439. "Color3",
  440. "LocalTransparencyModifier",
  441. "Shiny",
  442. "Specular",
  443. "StudsPerTileU",
  444. "StudsPerTileV",
  445. "FaceId",
  446. "InOut",
  447. "LeftRight",
  448. "TopBottom",
  449. "Heat",
  450. "SecondaryColor",
  451. "size",
  452. "Description",
  453. "AdditionalCoreIncludeDirs",
  454. "BubbleChatLifetime",
  455. "BubbleChatMaxBubbles",
  456. "ChatHistory",
  457. "ChatScrollLength",
  458. "CollisionSoundEnabled",
  459. "CollisionSoundVolume",
  460. "HardwareMouse",
  461. "MaxCollisionSounds",
  462. "OverrideStarterScript",
  463. "ReportAbuseChatHistory",
  464. "SoftwareSound",
  465. "VideoCaptureEnabled",
  466. "VideoQuality",
  467. "AbsolutePosition",
  468. "AbsoluteRotation",
  469. "AbsoluteSize",
  470. "AutoLocalize",
  471. "Localize",
  472. "RootLocalizationTable",
  473. "Active",
  474. "AnchorPoint",
  475. "BackgroundColor",
  476. "BackgroundColor3",
  477. "BackgroundTransparency",
  478. "BorderColor",
  479. "BorderColor3",
  480. "BorderSizePixel",
  481. "ClipsDescendants",
  482. "Draggable",
  483. "LayoutOrder",
  484. "NextSelectionDown",
  485. "NextSelectionLeft",
  486. "NextSelectionRight",
  487. "NextSelectionUp",
  488. "Selectable",
  489. "SizeConstraint",
  490. "SizeFromContents",
  491. "ZIndex",
  492. "Style",
  493. "AutoButtonColor",
  494. "Modal",
  495. "Selected",
  496. "Image",
  497. "ImageColor3",
  498. "ImageRectOffset",
  499. "ImageRectSize",
  500. "ImageTransparency",
  501. "IsLoaded",
  502. "ScaleType",
  503. "SliceCenter",
  504. "TileSize",
  505. "Font",
  506. "FontSize",
  507. "LineHeight",
  508. "LocalizedText",
  509. "Text",
  510. "TextBounds",
  511. "TextColor",
  512. "TextColor3",
  513. "TextFits",
  514. "TextScaled",
  515. "TextSize",
  516. "TextStrokeColor3",
  517. "TextStrokeTransparency",
  518. "TextTransparency",
  519. "TextTruncate",
  520. "TextWrap",
  521. "TextWrapped",
  522. "TextXAlignment",
  523. "TextYAlignment",
  524. "ScaleEdgeSize",
  525. "SlicePrefix",
  526. "AbsoluteWindowSize",
  527. "BottomImage",
  528. "CanvasPosition",
  529. "CanvasSize",
  530. "ElasticBehavior",
  531. "HorizontalScrollBarInset",
  532. "MidImage",
  533. "ScrollBarThickness",
  534. "ScrollingDirection",
  535. "ScrollingEnabled",
  536. "TopImage",
  537. "VerticalScrollBarInset",
  538. "VerticalScrollBarPosition",
  539. "ClearTextOnFocus",
  540. "ManualFocusRelease",
  541. "MultiLine",
  542. "OverlayNativeInput",
  543. "PlaceholderColor3",
  544. "PlaceholderText",
  545. "ShowNativeInput",
  546. "ResetOnSpawn",
  547. "ZIndexBehavior",
  548. "Adornee",
  549. "AlwaysOnTop",
  550. "ExtentsOffset",
  551. "ExtentsOffsetWorldSpace",
  552. "MaxDistance",
  553. "PlayerToHideFrom",
  554. "SizeOffset",
  555. "StudsOffset",
  556. "StudsOffsetWorldSpace",
  557. "HostWidgetWasRestored",
  558. "Title",
  559. "DisplayOrder",
  560. "ToolPunchThroughDistance",
  561. "CycleOffset",
  562. "From",
  563. "StudsBetweenTextures",
  564. "TextureSize",
  565. "To",
  566. "WireRadius",
  567. "SizeRelativeOffset",
  568. "Height",
  569. "A",
  570. "B",
  571. "C",
  572. "Range",
  573. "LineThickness",
  574. "SurfaceColor",
  575. "SurfaceColor3",
  576. "SurfaceTransparency",
  577. "Axes",
  578. "Faces",
  579. "TargetSurface",
  580. "Humanoid",
  581. "Part",
  582. "Point",
  583. "BinType",
  584. "CanBeDropped",
  585. "Grip",
  586. "GripForward",
  587. "GripPos",
  588. "GripRight",
  589. "GripUp",
  590. "ManualActivationOnly",
  591. "RequiresHandle",
  592. "ToolTip",
  593. "TeamColor",
  594. "AutoSelectGuiEnabled",
  595. "CoreEffectFolder",
  596. "CoreGuiFolder",
  597. "CoreGuiNavigationEnabled",
  598. "GuiNavigationEnabled",
  599. "IsModalDialog",
  600. "IsWindows",
  601. "MenuIsOpen",
  602. "SelectedCoreObject",
  603. "SelectedObject",
  604. "HttpEnabled",
  605. "AutoJumpEnabled",
  606. "AutoRotate",
  607. "CameraOffset",
  608. "DisplayDistanceType",
  609. "FloorMaterial",
  610. "Health",
  611. "HealthDisplayDistance",
  612. "HealthDisplayType",
  613. "HipHeight",
  614. "Jump",
  615. "JumpPower",
  616. "LeftLeg",
  617. "MaxHealth",
  618. "MaxSlopeAngle",
  619. "MoveDirection",
  620. "NameDisplayDistance",
  621. "NameOcclusion",
  622. "PlatformStand",
  623. "RigType",
  624. "RightLeg",
  625. "RootPart",
  626. "SeatPart",
  627. "Sit",
  628. "TargetPoint",
  629. "Torso",
  630. "WalkSpeed",
  631. "WalkToPart",
  632. "WalkToPoint",
  633. "maxHealth",
  634. "Delta",
  635. "KeyCode",
  636. "UserInputState",
  637. "UserInputType",
  638. "AllowInsertFreeModels",
  639. "C0",
  640. "C1",
  641. "Part0",
  642. "Part1",
  643. "part1",
  644. "BaseAngle",
  645. "F0",
  646. "F1",
  647. "F2",
  648. "F3",
  649. "DesiredAngle",
  650. "Transform",
  651. "Hole",
  652. "Time",
  653. "Loop",
  654. "Brightness",
  655. "Shadows",
  656. "Angle",
  657. "Ambient",
  658. "ClockTime",
  659. "ColorShift_Bottom",
  660. "ColorShift_Top",
  661. "FogColor",
  662. "FogEnd",
  663. "FogStart",
  664. "GeographicLatitude",
  665. "GlobalShadows",
  666. "OutdoorAmbient",
  667. "Outlines",
  668. "ShadowColor",
  669. "TimeOfDay",
  670. "ForcePlayModeRobloxLocaleId",
  671. "IsTextScraperRunning",
  672. "RobloxForcePlayModeRobloxLocaleId",
  673. "RobloxLocaleId",
  674. "SystemLocaleId",
  675. "DevelopmentLanguage",
  676. "Root",
  677. "SourceLocaleId",
  678. "AreScriptStartsReported",
  679. "DefaultWaitTime",
  680. "GcFrequency",
  681. "GcLimit",
  682. "GcPause",
  683. "GcStepMul",
  684. "WaitingThreadsBudget",
  685. "Disabled",
  686. "LinkedSource",
  687. "Hit",
  688. "Origin",
  689. "TargetFilter",
  690. "UnitRay",
  691. "ViewSizeX",
  692. "ViewSizeY",
  693. "X",
  694. "Y",
  695. "hit",
  696. "target",
  697. "Ticket",
  698. "Port",
  699. "ArePhysicsRejectionsReported",
  700. "ClientPhysicsSendRate",
  701. "DataGCRate",
  702. "DataMtuAdjust",
  703. "DataSendPriority",
  704. "DataSendRate",
  705. "ExtraMemoryUsed",
  706. "FreeMemoryMBytes",
  707. "IncommingReplicationLag",
  708. "IsQueueErrorComputed",
  709. "NetworkOwnerRate",
  710. "PhysicsMtuAdjust",
  711. "PhysicsSendPriority",
  712. "PhysicsSendRate",
  713. "PreferredClientPort",
  714. "PrintBits",
  715. "PrintEvents",
  716. "PrintFilters",
  717. "PrintInstances",
  718. "PrintPhysicsErrors",
  719. "PrintProperties",
  720. "PrintSplitMessage",
  721. "PrintStreamInstanceQuota",
  722. "PrintTouches",
  723. "ReceiveRate",
  724. "RenderStreamedRegions",
  725. "ShowActiveAnimationAsset",
  726. "TouchSendRate",
  727. "TrackDataTypes",
  728. "TrackPhysicsDetails",
  729. "UseInstancePacketCache",
  730. "UsePhysicsPacketCache",
  731. "Anchored",
  732. "BackParamA",
  733. "BackParamB",
  734. "BackSurface",
  735. "BackSurfaceInput",
  736. "BottomParamA",
  737. "BottomParamB",
  738. "BottomSurface",
  739. "BottomSurfaceInput",
  740. "BrickColor",
  741. "CanCollide",
  742. "CenterOfMass",
  743. "CollisionGroupId",
  744. "CustomPhysicalProperties",
  745. "Elasticity",
  746. "Friction",
  747. "FrontParamA",
  748. "FrontParamB",
  749. "FrontSurface",
  750. "FrontSurfaceInput",
  751. "LeftParamA",
  752. "LeftParamB",
  753. "LeftSurface",
  754. "LeftSurfaceInput",
  755. "Locked",
  756. "Material",
  757. "ReceiveAge",
  758. "Reflectance",
  759. "ResizeIncrement",
  760. "ResizeableFaces",
  761. "RightParamA",
  762. "RightParamB",
  763. "RightSurface",
  764. "RightSurfaceInput",
  765. "RotVelocity",
  766. "SpecificGravity",
  767. "TopParamA",
  768. "TopParamB",
  769. "TopSurface",
  770. "TopSurfaceInput",
  771. "brickColor",
  772. "FormFactor",
  773. "formFactor",
  774. "Shape",
  775. "Occupant",
  776. "Controller",
  777. "ControllingHumanoid",
  778. "StickyWheels",
  779. "AllowTeamChangeOnTouch",
  780. "Duration",
  781. "Neutral",
  782. "TextureID",
  783. "TriangleCount",
  784. "UsePartColor",
  785. "IsSmooth",
  786. "MaxExtents",
  787. "WaterColor",
  788. "WaterReflectance",
  789. "WaterTransparency",
  790. "WaterWaveSize",
  791. "WaterWaveSpeed",
  792. "AreHingesDetected",
  793. "HeadsUpDisplay",
  794. "SteerFloat",
  795. "ThrottleFloat",
  796. "TurnSpeed",
  797. "PrimaryPart",
  798. "AllowThirdPartySales",
  799. "CurrentCamera",
  800. "DistributedGameTime",
  801. "FallenPartsDestroyHeight",
  802. "FilteringEnabled",
  803. "Gravity",
  804. "StreamingEnabled",
  805. "Terrain",
  806. "IsFinished",
  807. "Acceleration",
  808. "Drag",
  809. "EmissionDirection",
  810. "Lifetime",
  811. "LockedToPart",
  812. "Rate",
  813. "RotSpeed",
  814. "SpreadAngle",
  815. "VelocityInheritance",
  816. "VelocitySpread",
  817. "Status",
  818. "EmptyCutoff",
  819. "AllowSleep",
  820. "AreAnchorsShown",
  821. "AreAssembliesShown",
  822. "AreAwakePartsHighlighted",
  823. "AreBodyTypesShown",
  824. "AreContactIslandsShown",
  825. "AreContactPointsShown",
  826. "AreJointCoordinatesShown",
  827. "AreMechanismsShown",
  828. "AreModelCoordsShown",
  829. "AreOwnersShown",
  830. "ArePartCoordsShown",
  831. "AreRegionsShown",
  832. "AreUnalignedPartsShown",
  833. "AreWorldCoordsShown",
  834. "DisableCSGv2",
  835. "IsReceiveAgeShown",
  836. "IsTreeShown",
  837. "ParallelPhysics",
  838. "PhysicsAnalyzerEnabled",
  839. "PhysicsEnvironmentalThrottle",
  840. "ShowDecompositionGeometry",
  841. "ThrottleAdjustTime",
  842. "UseCSGv2",
  843. "AccountAge",
  844. "AppearanceDidLoad",
  845. "CameraMaxZoomDistance",
  846. "CameraMinZoomDistance",
  847. "CameraMode",
  848. "CanLoadCharacterAppearance",
  849. "Character",
  850. "CharacterAppearance",
  851. "CharacterAppearanceId",
  852. "ChatMode",
  853. "DataComplexity",
  854. "DataComplexityLimit",
  855. "DataReady",
  856. "DevCameraOcclusionMode",
  857. "DevComputerCameraMode",
  858. "DevComputerMovementMode",
  859. "DevEnableMouseLock",
  860. "DevTouchCameraMode",
  861. "DevTouchMovementMode",
  862. "DisplayName",
  863. "FollowUserId",
  864. "Guest",
  865. "LocaleId",
  866. "MaximumSimulationRadius",
  867. "MembershipType",
  868. "ReplicationFocus",
  869. "RespawnLocation",
  870. "SimulationRadius",
  871. "Team",
  872. "Teleported",
  873. "TeleportedIn",
  874. "UserId",
  875. "VRDevice",
  876. "userId",
  877. "BubbleChat",
  878. "CharacterAutoLoads",
  879. "ClassicChat",
  880. "LocalPlayer",
  881. "MaxPlayers",
  882. "MaxPlayersInternal",
  883. "NumPlayers",
  884. "PreferredPlayers",
  885. "PreferredPlayersInternal",
  886. "localPlayer",
  887. "numPlayers",
  888. "CollisionEnabled",
  889. "GridSize",
  890. "ActionId",
  891. "StatusTip",
  892. "EasingDirection",
  893. "EasingStyle",
  894. "MaskWeight",
  895. "Weight",
  896. "Intensity",
  897. "Threshold",
  898. "Contrast",
  899. "Saturation",
  900. "TintColor",
  901. "Spread",
  902. "Browsable",
  903. "ClassCategory",
  904. "Constraint",
  905. "Deprecated",
  906. "EditingDisabled",
  907. "IsBackend",
  908. "ScriptContext",
  909. "UIMaximum",
  910. "UIMinimum",
  911. "UINumTicks",
  912. "summary",
  913. "ExplorerImageIndex",
  914. "ExplorerOrder",
  915. "Insertable",
  916. "PreferredParent",
  917. "AutoFRMLevel",
  918. "EagerBulkExecution",
  919. "EditQualityLevel",
  920. "EnableFRM",
  921. "ExportMergeByMaterial",
  922. "FrameRateManager",
  923. "GraphicsMode",
  924. "MeshCacheSize",
  925. "QualityLevel",
  926. "ReloadAssets",
  927. "RenderCSGTrianglesDebug",
  928. "ShowBoundingBoxes",
  929. "ScriptsDisabled",
  930. "CurrentLine",
  931. "IsDebugging",
  932. "IsPaused",
  933. "Script",
  934. "CreatorId",
  935. "CreatorType",
  936. "GameId",
  937. "GearGenreSetting",
  938. "Genre",
  939. "IsSFFlagsLoaded",
  940. "JobId",
  941. "PlaceId",
  942. "PlaceVersion",
  943. "VIPServerId",
  944. "VIPServerOwnerId",
  945. "Workspace",
  946. "lighting",
  947. "workspace",
  948. "CelestialBodiesShown",
  949. "MoonAngularSize",
  950. "MoonTextureId",
  951. "SkyboxBk",
  952. "SkyboxDn",
  953. "SkyboxFt",
  954. "SkyboxLf",
  955. "SkyboxRt",
  956. "SkyboxUp",
  957. "StarCount",
  958. "SunAngularSize",
  959. "SunTextureId",
  960. "Opacity",
  961. "RiseVelocity",
  962. "EmitterSize",
  963. "MinDistance",
  964. "Pitch",
  965. "PlayOnRemove",
  966. "PlaybackLoudness",
  967. "PlaybackSpeed",
  968. "Playing",
  969. "RollOffMode",
  970. "SoundGroup",
  971. "SoundId",
  972. "TimeLength",
  973. "Volume",
  974. "isPlaying",
  975. "Depth",
  976. "Mix",
  977. "Attack",
  978. "GainMakeup",
  979. "Ratio",
  980. "Release",
  981. "SideChain",
  982. "Level",
  983. "Delay",
  984. "DryLevel",
  985. "Feedback",
  986. "WetLevel",
  987. "HighGain",
  988. "LowGain",
  989. "MidGain",
  990. "Octave",
  991. "DecayTime",
  992. "Density",
  993. "Diffusion",
  994. "Duty",
  995. "Frequency",
  996. "AmbientReverb",
  997. "DistanceFactor",
  998. "DopplerScale",
  999. "RespectFilteringEnabled",
  1000. "RolloffScale",
  1001. "SparkleColor",
  1002. "AllowCustomAnimations",
  1003. "DevComputerCameraMovementMode",
  1004. "DevTouchCameraMovementMode",
  1005. "EnableMouseLockOption",
  1006. "LoadCharacterAppearance",
  1007. "ContactsCount",
  1008. "DataReceiveKbps",
  1009. "DataSendKbps",
  1010. "HeartbeatTimeMs",
  1011. "MovingPrimitivesCount",
  1012. "PhysicsReceiveKbps",
  1013. "PhysicsSendKbps",
  1014. "PhysicsStepTimeMs",
  1015. "PrimitivesCount",
  1016. "SchedulerDutyCycle",
  1017. "SchedulerRate",
  1018. "ThreadPoolConfig",
  1019. "ThreadPoolSize",
  1020. "AutoAssignable",
  1021. "AutoColorCharacters",
  1022. "Score",
  1023. "CustomizedTeleportUI",
  1024. "SizeInCells",
  1025. "AutoRuns",
  1026. "ErrorCount",
  1027. "ExecuteWithStudioRun",
  1028. "Is30FpsThrottleEnabled",
  1029. "IsPhysicsEnvironmentalThrottled",
  1030. "IsSleepAllowed",
  1031. "NumberOfPlayers",
  1032. "SimulateSecondsLag",
  1033. "TestCount",
  1034. "Timeout",
  1035. "WarnCount",
  1036. "WidthScale",
  1037. "PlaybackState",
  1038. "Instance",
  1039. "TweenInfo",
  1040. "AspectRatio",
  1041. "AspectType",
  1042. "DominantAxis",
  1043. "MaxSize",
  1044. "MinSize",
  1045. "MaxTextSize",
  1046. "MinTextSize",
  1047. "AbsoluteContentSize",
  1048. "FillDirection",
  1049. "HorizontalAlignment",
  1050. "SortOrder",
  1051. "VerticalAlignment",
  1052. "CellPadding",
  1053. "CellSize",
  1054. "FillDirectionMaxCells",
  1055. "StartCorner",
  1056. "Padding",
  1057. "Animated",
  1058. "Circular",
  1059. "CurrentPage",
  1060. "GamepadInputEnabled",
  1061. "ScrollWheelInputEnabled",
  1062. "TouchInputEnabled",
  1063. "TweenTime",
  1064. "FillEmptySpaceColumns",
  1065. "FillEmptySpaceRows",
  1066. "MajorAxis",
  1067. "PaddingBottom",
  1068. "PaddingLeft",
  1069. "PaddingRight",
  1070. "PaddingTop",
  1071. "AllTutorialsDisabled",
  1072. "CameraYInverted",
  1073. "ChatVisible",
  1074. "ComputerCameraMovementMode",
  1075. "ComputerMovementMode",
  1076. "ControlMode",
  1077. "Fullscreen",
  1078. "GamepadCameraSensitivity",
  1079. "HasEverUsedVR",
  1080. "IsUsingCameraYInverted",
  1081. "IsUsingGamepadCameraSensitivity",
  1082. "MasterVolume",
  1083. "MicroProfilerEnabled",
  1084. "MicroProfilerWebServerEnabled",
  1085. "MicroProfilerWebServerIP",
  1086. "MicroProfilerWebServerPort",
  1087. "MouseSensitivity",
  1088. "MouseSensitivityFirstPerson",
  1089. "MouseSensitivityThirdPerson",
  1090. "OnboardingsCompleted",
  1091. "PerformanceStatsVisible",
  1092. "RotationType",
  1093. "SavedQualityLevel",
  1094. "TouchCameraMovementMode",
  1095. "TouchMovementMode",
  1096. "UsedCoreGuiIsVisibleToggle",
  1097. "UsedCustomGuiIsVisibleToggle",
  1098. "UsedHideHudShortcut",
  1099. "VREnabled",
  1100. "VRRotationIntensity",
  1101. "AccelerometerEnabled",
  1102. "BottomBarSize",
  1103. "GamepadEnabled",
  1104. "GazeSelectionEnabled",
  1105. "GyroscopeEnabled",
  1106. "KeyboardEnabled",
  1107. "LegacyInputEventsEnabled",
  1108. "ModalEnabled",
  1109. "MouseBehavior",
  1110. "MouseDeltaSensitivity",
  1111. "MouseEnabled",
  1112. "MouseIconEnabled",
  1113. "NavBarSize",
  1114. "OnScreenKeyboardAnimationDuration",
  1115. "OnScreenKeyboardPosition",
  1116. "OnScreenKeyboardSize",
  1117. "OnScreenKeyboardVisible",
  1118. "OverrideMouseIconBehavior",
  1119. "StatusBarSize",
  1120. "TouchEnabled",
  1121. "UserHeadCFrame",
  1122. "GuiInputUserCFrame",
  1123. "VRDeviceName",
  1124. "Value",
  1125. "ConstrainedValue",
  1126. "MaxValue",
  1127. "MinValue",
  1128. "AdditionalLuaState",
  1129. }
  1130. local count = 0
  1131. local vars = {
  1132.  
  1133. }
  1134. function supported(obj)
  1135. if supportedClasses[obj.className] then
  1136. return true
  1137. end
  1138. return false
  1139. end
  1140. function propertyExists(udata,property)
  1141. local ret,def = pcall(function() return udata[property] end)
  1142. local e = Instance.new(udata.className,nil)
  1143. local ret1,def = pcall(function() e[property] = udata[property] end)
  1144. if e:IsA("GuiObject") and property=="Transparency" then return false end
  1145. e:Destroy()
  1146. return (ret and ret1)
  1147. end
  1148. function getVariable(obj)
  1149. return vars[obj]
  1150. end
  1151. function assignVariable(obj)
  1152. vars[obj] = ("%s%s"):format(obj.className,count)
  1153. count = count + 1
  1154. return vars[obj]
  1155. end
  1156. function serializeProperty(prop)
  1157. if typeof(prop)=="Vector2" or typeof(prop) == "Vector3" or typeof(prop) == "UDim" or typeof(prop)=="Color3" or typeof(prop)=="CFrame" then
  1158. return ("%s.new(%s)"):format(typeof(prop),tostring(prop))
  1159. elseif typeof(prop)=="BrickColor" then
  1160. return ("BrickColor.new(\"%s\")"):format(tostring(prop))
  1161. elseif typeof(prop)=="UDim2" then
  1162. return ("UDim2.new(%s, %s)"):format(tostring(prop.X),tostring(prop.Y))
  1163. elseif typeof(prop)=="Instance" then
  1164. return tostring(vars[prop])
  1165. elseif typeof(prop)=="string" then
  1166. return ("\"%s\""):format(prop)
  1167. elseif typeof(prop)=="NumberRange" then
  1168. return ("NumberRange.new(%s, %s)"):format(prop.Min,prop.Max)
  1169. elseif typeof(prop)=="Faces" then
  1170. local tr = {}
  1171. if prop.Top==true then
  1172. table.insert(tr,tostring(Enum.NormalId.Top))
  1173. end
  1174. if prop.Bottom==true then
  1175. table.insert(tr,tostring(Enum.NormalId.Bottom))
  1176. end
  1177. if prop.Back==true then
  1178. table.insert(tr,tostring(Enum.NormalId.Back))
  1179. end
  1180. if prop.Front==true then
  1181. table.insert(tr,tostring(Enum.NormalId.Front))
  1182. end
  1183. if prop.Right==true then
  1184. table.insert(tr,tostring(Enum.NormalId.Right))
  1185. end
  1186. if prop.Left==true then
  1187. table.insert(tr,tostring(Enum.NormalId.Left))
  1188. end
  1189. return ("Faces.new(%s)"):format(table.concat(tr,","))
  1190. elseif typeof(prop)=="Axes" then
  1191. local tr = {}
  1192. if prop.X==true then
  1193. table.insert(tr,tostring(Enum.Axis.X))
  1194. end
  1195. if prop.Top==true then
  1196. table.insert(tr,tostring(Enum.NormalId.Top))
  1197. end
  1198. if prop.Bottom==true then
  1199. table.insert(tr,tostring(Enum.NormalId.Bottom))
  1200. end
  1201. if prop.Y==true then
  1202. table.insert(tr,tostring(Enum.Axis.Y))
  1203. end
  1204. if prop.Back==true then
  1205. table.insert(tr,tostring(Enum.NormalId.Back))
  1206. end
  1207. if prop.Front==true then
  1208. table.insert(tr,tostring(Enum.NormalId.Front))
  1209. end
  1210. if prop.Z==true then
  1211. table.insert(tr,tostring(Enum.Axis.Z))
  1212. end
  1213. if prop.Right==true then
  1214. table.insert(tr,tostring(Enum.NormalId.Right))
  1215. end
  1216. if prop.Left==true then
  1217. table.insert(tr,tostring(Enum.NormalId.Left))
  1218. end
  1219. return ("Axes.new(%s)"):format(table.concat(tr,","))
  1220. elseif typeof(prop)=="NumberSequence" or typeof(prop)=="ColorSequence" then
  1221. local tr = {}
  1222. for i,v in pairs(prop.Keypoints) do
  1223. table.insert(tr,serializeProperty(v.Value))
  1224. end
  1225. return ("%s.new(%s)"):format(typeof(prop),table.concat(tr,","))
  1226. elseif typeof(prop)=="Ray" then
  1227. return ("Ray.new(%s,%s)"):format(serializeProperty(prop.Origin),serializeProperty(prop.Direction))
  1228. end
  1229. return tostring(prop)
  1230. end
  1231. function isChanged(obj,prop)
  1232. local test = Instance.new(obj.className)
  1233. local bool = obj[prop]==test[prop]
  1234. test:Destroy()
  1235. return not bool
  1236. end
  1237. function createDeclaration(obj)
  1238. local var = assignVariable(obj)
  1239. return ("%s = Instance.new(\"%s\")"):format(var,obj.className)
  1240. end
  1241. function createFunction(var,source)
  1242. local s = "table.insert(cors,sandbox(%s,function()\n%s\nend))"
  1243. return s:format(var,source)
  1244. end
  1245. function serializeObjectProperties(obj)
  1246. local var = getVariable(obj)
  1247. if var~=nil then
  1248. local strs = {}
  1249. for i,v in pairs(supportedProperties) do
  1250. if v=="Source" then
  1251. -- Read the editor's current text, including any open draft.
  1252. -- Do not probe Source by assigning it on a temporary script.
  1253. if obj:IsA("LuaSourceContainer") then
  1254. local source = game:GetService("ScriptEditorService"):GetEditorSource(obj)
  1255. if source~="" then
  1256. table.insert(strs,createFunction(var,source))
  1257. end
  1258. end
  1259. elseif propertyExists(obj,v) and isChanged(obj,v) then
  1260. if v=="Parent" then
  1261. local str = ("%s.Parent = %s"):format(var,vars[obj.Parent] or "mas")
  1262. table.insert(strs,str)
  1263. else
  1264. local str = ("%s.%s = %s"):format(var,v,serializeProperty(obj[v]))
  1265. table.insert(strs,str)
  1266. end
  1267. end
  1268. end
  1269. return table.concat(strs,"\n")
  1270. end
  1271. return nil
  1272. end
  1273. header = [[
  1274. --Converted with ttyyuu12345's model to script plugin v4
  1275. function sandbox(var,func)
  1276. local env = getfenv(func)
  1277. local newenv = setmetatable({},{
  1278. __index = function(self,k)
  1279. if k=="script" then
  1280. return var
  1281. else
  1282. return env[k]
  1283. end
  1284. end,
  1285. })
  1286. setfenv(func,newenv)
  1287. return func
  1288. end
  1289. cors = {}
  1290. mas = Instance.new("Model",game:GetService("Lighting"))]]
  1291. footer = [[
  1292. for i,v in pairs(cors) do
  1293. spawn(function()
  1294. pcall(v)
  1295. end)
  1296. end
  1297. ]]
  1298. local orig_header = header
  1299. local orig_footer = footer
  1300. local parent = "workspace"
  1301. local typeScript = "Script"
  1302. local selection = {}
  1303. tree = function(obj)
  1304. local ret = {}
  1305. local args = {}
  1306. local chil = obj:GetChildren()
  1307. for i,v in pairs(chil) do
  1308. if supported(v) then
  1309. table.insert(ret,v)
  1310. end
  1311. local subTree = tree(v)
  1312. for j,u in pairs(subTree) do
  1313. table.insert(ret,u)
  1314. end
  1315. end
  1316. return ret
  1317. end
  1318. function combine(...)
  1319. local args = {...}
  1320. local ret = args[1] or {}
  1321. for i=2,#args do
  1322. table.insert(ret,args[i])
  1323. end
  1324. return ret
  1325. end
  1326. local clearObjects = false
  1327. local isCompiling = false
  1328. function Compile()
  1329. if isCompiling then
  1330. warn("A conversion is already in progress")
  1331. return nil
  1332. end
  1333. isCompiling = true
  1334.  
  1335. -- Capture this run's options before any yielding operation.
  1336. local selectedObjects = selection
  1337. local outputType = typeScript
  1338. local outputParent = parent
  1339. local shouldClearObjects = clearObjects
  1340. selection = {}
  1341. clearObjects = false
  1342. count = 0
  1343. vars = {}
  1344.  
  1345. local outputScript
  1346. local success, result = pcall(function()
  1347. print("This might take a few minutes, freezing is to be expected")
  1348. task.wait()
  1349.  
  1350. -- One buffer, with no character-based splitting or extra output scripts.
  1351. local sourceParts = {}
  1352. local function concatenate(str)
  1353. if str~=nil then
  1354. table.insert(sourceParts,str)
  1355. end
  1356. end
  1357.  
  1358. local compiledHeader = orig_header
  1359. local compiledFooter = orig_footer
  1360. if outputType=="ModuleScript" then
  1361. compiledHeader = "return function()\n" .. compiledHeader
  1362. compiledFooter = compiledFooter .. "\nend"
  1363. end
  1364. concatenate(compiledHeader)
  1365.  
  1366. local items = {}
  1367. for i,v in pairs(selectedObjects) do
  1368. if supported(v) then table.insert(items,v) end
  1369. local tr = tree(v)
  1370. for j,u in pairs(tr) do
  1371. table.insert(items,u)
  1372. end
  1373. end
  1374. if shouldClearObjects then
  1375. concatenate("local chil = workspace:GetChildren()\nfor i,v in pairs(chil) do\n\tif not (v==script or v:IsA(\"Camera\") or v:IsA(\"Terrain\") or game:GetService(\"Players\"):GetPlayerFromCharacter(v)~=nil) then\n\t\tv:Destroy()\n\tend\nend")
  1376. end
  1377. for i,v in pairs(items) do
  1378. concatenate(createDeclaration(v))
  1379. end
  1380. for i,v in pairs(items) do
  1381. concatenate(serializeObjectProperties(v))
  1382. end
  1383. local moveObjects = ("for i,v in pairs(mas:GetChildren()) do\n\tv.Parent = %s\n\tpcall(function() v:MakeJoints() end)\nend\nmas:Destroy()"):format(outputParent)
  1384. concatenate(moveObjects)
  1385. concatenate(compiledFooter)
  1386.  
  1387. local source = table.concat(sourceParts,"\n")
  1388. outputScript = Instance.new(outputType)
  1389. outputScript.Name = "CompiledScript"
  1390.  
  1391. -- This callback must not yield and may be retried by Studio.
  1392. -- Build the complete source above, then return the same text each time.
  1393. game:GetService("ScriptEditorService"):UpdateSourceAsync(outputScript,function(_oldSource)
  1394. return source
  1395. end)
  1396.  
  1397. -- Publish only after the source update succeeds.
  1398. outputScript.Parent = workspace
  1399. return outputScript
  1400. end)
  1401.  
  1402. -- Release references and allow another conversion, even after an API error.
  1403. count = 0
  1404. vars = {}
  1405. isCompiling = false
  1406. if not success then
  1407. if outputScript then
  1408. outputScript:Destroy()
  1409. end
  1410. warn("Conversion failed: " .. tostring(result))
  1411. return nil
  1412. end
  1413. print("done")
  1414. return result
  1415. end
  1416.  
  1417. -- SELF-CONTAINED UI
  1418. -- Every GUI object below is created in code. No children of script are required.
  1419. local CoreGui = game:GetService("CoreGui")
  1420. local SelectionService = game:GetService("Selection")
  1421. local UserInputService = game:GetService("UserInputService")
  1422. local RunService = game:GetService("RunService")
  1423. local pluginHandle = plugin -- nil is supported when running from the Command Bar.
  1424.  
  1425. if not RunService:IsStudio() then
  1426. error("M2S must run in Roblox Studio, as a plugin or from the Command Bar.", 0)
  1427. end
  1428.  
  1429. local INIT_NAME = "M2S_Standalone_Init"
  1430. local WINDOW_NAME = "M2S_Standalone_ConverterGui"
  1431.  
  1432. -- Rerunning from the Command Bar replaces this tool's previous UI.
  1433. for _, name in ipairs({INIT_NAME, WINDOW_NAME}) do
  1434. local previous = CoreGui:FindFirstChild(name)
  1435. if previous then
  1436. previous:Destroy()
  1437. end
  1438. end
  1439.  
  1440. local colors = {
  1441. Window = Color3.fromRGB(43, 45, 50),
  1442. Title = Color3.fromRGB(30, 32, 36),
  1443. Button = Color3.fromRGB(62, 65, 72),
  1444. Primary = Color3.fromRGB(40, 104, 184),
  1445. Border = Color3.fromRGB(84, 87, 94),
  1446. Text = Color3.fromRGB(242, 243, 245),
  1447. Muted = Color3.fromRGB(188, 193, 202),
  1448. Warning = Color3.fromRGB(244, 204, 117),
  1449. Close = Color3.fromRGB(130, 55, 55),
  1450. }
  1451.  
  1452. local function make(className, properties, objectParent)
  1453. local object = Instance.new(className)
  1454. for property, value in pairs(properties) do
  1455. object[property] = value
  1456. end
  1457. object.Parent = objectParent
  1458. return object
  1459. end
  1460.  
  1461. local function disconnectAll(connections)
  1462. for _, connection in ipairs(connections) do
  1463. connection:Disconnect()
  1464. end
  1465. end
  1466.  
  1467. -- ConverterGui > Main > Holder / TitleBar > Exit / Title, as in the old plugin.
  1468. -- These are unparented templates, not assets that must be installed separately.
  1469. local promptGui = make("ScreenGui", {
  1470. Name = "ConverterGui",
  1471. ResetOnSpawn = false,
  1472. IgnoreGuiInset = false,
  1473. DisplayOrder = 101,
  1474. ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
  1475. })
  1476. local mainTemplate = make("Frame", {
  1477. Name = "Main",
  1478. AnchorPoint = Vector2.new(0.5, 0.5),
  1479. Position = UDim2.new(0.5, 0, 0.5, 0),
  1480. Size = UDim2.new(1, -32, 1, -32),
  1481. BackgroundColor3 = colors.Window,
  1482. BorderColor3 = colors.Border,
  1483. BorderSizePixel = 1,
  1484. Active = true,
  1485. }, promptGui)
  1486. make("UISizeConstraint", {
  1487. MinSize = Vector2.new(280, 230),
  1488. MaxSize = Vector2.new(490, 356),
  1489. }, mainTemplate)
  1490. local titleBarTemplate = make("Frame", {
  1491. Name = "TitleBar",
  1492. Size = UDim2.new(1, 0, 0, 38),
  1493. BackgroundColor3 = colors.Title,
  1494. BorderSizePixel = 0,
  1495. Active = true,
  1496. }, mainTemplate)
  1497. make("TextLabel", {
  1498. Name = "Title",
  1499. Position = UDim2.new(0, 12, 0, 0),
  1500. Size = UDim2.new(1, -60, 1, 0),
  1501. BackgroundTransparency = 1,
  1502. Font = Enum.Font.SourceSansSemibold,
  1503. Text = "Model to Script",
  1504. TextSize = 18,
  1505. TextColor3 = colors.Text,
  1506. TextXAlignment = Enum.TextXAlignment.Left,
  1507. TextTruncate = Enum.TextTruncate.AtEnd,
  1508. }, titleBarTemplate)
  1509. make("TextButton", {
  1510. Name = "Exit",
  1511. AnchorPoint = Vector2.new(1, 0),
  1512. Position = UDim2.new(1, 0, 0, 0),
  1513. Size = UDim2.new(0, 40, 1, 0),
  1514. BackgroundColor3 = colors.Close,
  1515. BorderSizePixel = 0,
  1516. Font = Enum.Font.SourceSansSemibold,
  1517. Text = "X",
  1518. TextSize = 18,
  1519. TextColor3 = colors.Text,
  1520. AutoButtonColor = true,
  1521. }, titleBarTemplate)
  1522. make("Frame", {
  1523. Name = "Holder",
  1524. Position = UDim2.new(0, 12, 0, 50),
  1525. Size = UDim2.new(1, -24, 1, -88),
  1526. BackgroundTransparency = 1,
  1527. BorderSizePixel = 0,
  1528. ClipsDescendants = true,
  1529. }, mainTemplate)
  1530. make("TextLabel", {
  1531. Name = "Footer",
  1532. Position = UDim2.new(0, 12, 1, -28),
  1533. Size = UDim2.new(1, -24, 0, 20),
  1534. BackgroundTransparency = 1,
  1535. Font = Enum.Font.SourceSans,
  1536. Text = "Model to Script",
  1537. TextSize = 13,
  1538. TextColor3 = colors.Muted,
  1539. TextXAlignment = Enum.TextXAlignment.Left,
  1540. TextTruncate = Enum.TextTruncate.AtEnd,
  1541. }, mainTemplate)
  1542.  
  1543. -- Prompt > UIGridLayout and OptionButton are also rebuilt entirely in code.
  1544. local promptBasis = make("ScrollingFrame", {
  1545. Name = "Prompt",
  1546. Size = UDim2.new(1, 0, 1, 0),
  1547. BackgroundTransparency = 1,
  1548. BorderSizePixel = 0,
  1549. CanvasSize = UDim2.new(0, 0, 0, 0),
  1550. AutomaticCanvasSize = Enum.AutomaticSize.Y,
  1551. ScrollingDirection = Enum.ScrollingDirection.Y,
  1552. ScrollBarThickness = 6,
  1553. ScrollBarImageColor3 = colors.Muted,
  1554. })
  1555. make("UIGridLayout", {
  1556. Name = "UIGridLayout",
  1557. CellSize = UDim2.new(1, -10, 0, 38),
  1558. CellPadding = UDim2.new(0, 0, 0, 7),
  1559. FillDirection = Enum.FillDirection.Horizontal,
  1560. FillDirectionMaxCells = 1,
  1561. SortOrder = Enum.SortOrder.LayoutOrder,
  1562. HorizontalAlignment = Enum.HorizontalAlignment.Left,
  1563. VerticalAlignment = Enum.VerticalAlignment.Top,
  1564. }, promptBasis)
  1565. local optionBasis = make("TextButton", {
  1566. Name = "OptionButton",
  1567. Size = UDim2.new(1, 0, 0, 38),
  1568. BackgroundColor3 = colors.Button,
  1569. BorderSizePixel = 0,
  1570. Font = Enum.Font.SourceSans,
  1571. Text = "Option",
  1572. TextSize = 16,
  1573. TextColor3 = colors.Text,
  1574. TextWrapped = true,
  1575. AutoButtonColor = true,
  1576. })
  1577.  
  1578. -- Init > Open: the small launcher that the M2S toolbar button toggles.
  1579. local init = make("ScreenGui", {
  1580. Name = INIT_NAME,
  1581. ResetOnSpawn = false,
  1582. IgnoreGuiInset = false,
  1583. DisplayOrder = 100,
  1584. ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
  1585. }, CoreGui)
  1586. local launcher = make("TextButton", {
  1587. Name = "Open",
  1588. Position = UDim2.new(0, 12, 0, 56),
  1589. Size = UDim2.new(0, 140, 0, 34),
  1590. BackgroundColor3 = colors.Title,
  1591. BorderColor3 = colors.Border,
  1592. BorderSizePixel = 1,
  1593. Font = Enum.Font.SourceSansSemibold,
  1594. Text = "Open M2S",
  1595. TextSize = 16,
  1596. TextColor3 = colors.Text,
  1597. AutoButtonColor = true,
  1598. }, init)
  1599.  
  1600. local activePrompt
  1601. local uiBusy = false
  1602. local disposed = false
  1603. local windowConnections = {}
  1604. local lifetimeConnections = {}
  1605. local toolbar
  1606. local toolbarButton
  1607.  
  1608. local function resetOptions()
  1609. typeScript = "Script"
  1610. parent = "workspace"
  1611. selection = {}
  1612. clearObjects = false
  1613. end
  1614.  
  1615. local function closePrompt()
  1616. disconnectAll(windowConnections)
  1617. windowConnections = {}
  1618. local oldPrompt = activePrompt
  1619. activePrompt = nil
  1620. if oldPrompt then
  1621. oldPrompt:Destroy()
  1622. end
  1623. uiBusy = isCompiling
  1624. if not isCompiling then
  1625. resetOptions()
  1626. end
  1627. end
  1628.  
  1629. local function renderPage(titleText, footerText, rows)
  1630. local root = activePrompt
  1631. if disposed or not root then return end
  1632. local main = root.Main
  1633. main.TitleBar.Title.Text = titleText
  1634. main.Footer.Text = footerText
  1635. local previous = main.Holder:FindFirstChild("Prompt")
  1636. if previous then previous:Destroy() end
  1637. local optionFrame = promptBasis:Clone()
  1638. optionFrame.Parent = main.Holder
  1639. for index, row in ipairs(rows) do
  1640. local entry = row
  1641. local button = optionBasis:Clone()
  1642. button.LayoutOrder = index
  1643. button.Text = entry.Text
  1644. if entry.Info then
  1645. button.Name = "Message"
  1646. button.BackgroundTransparency = 1
  1647. button.TextColor3 = entry.Warning and colors.Warning or colors.Muted
  1648. button.TextXAlignment = Enum.TextXAlignment.Left
  1649. button.AutoButtonColor = false
  1650. button.Active = false
  1651. button.Selectable = false
  1652. else
  1653. button.BackgroundColor3 = entry.Primary and colors.Primary or colors.Button
  1654. button.Activated:Connect(function()
  1655. if disposed or activePrompt~=root or uiBusy then return end
  1656. entry.Action()
  1657. end)
  1658. end
  1659. button.Parent = optionFrame
  1660. end
  1661. end
  1662.  
  1663. local showPrompt
  1664. local beginCompilation
  1665.  
  1666. local Prompts = {
  1667. {
  1668. Title = "Terms of service",
  1669. Text = {
  1670. "Do not use this to create inappropriate scripts",
  1671. "The Roblox ToS is expected to be upheld",
  1672. "Do not use this to be abusive on Void SB",
  1673. },
  1674. Options = function()
  1675. return {
  1676. {Text = "Accept", Primary = true, Action = function() end},
  1677. -- Unlike the old script, Decline cancels instead of freezing Studio.
  1678. {Text = "Decline", Cancel = true},
  1679. }
  1680. end,
  1681. },
  1682. {
  1683. Title = "Please select a type of script",
  1684. Options = function()
  1685. return {
  1686. {Text = "Script", Action = function() typeScript = "Script" end},
  1687. {Text = "LocalScript", Action = function() typeScript = "LocalScript" end},
  1688. {Text = "ModuleScript", Action = function() typeScript = "ModuleScript" end},
  1689. }
  1690. end,
  1691. },
  1692. {
  1693. Title = "Please select a parent",
  1694. Options = function()
  1695. local options = {
  1696. {Text = "workspace", Action = function() parent = "workspace" end},
  1697. {Text = "script", Action = function() parent = "script" end},
  1698. {Text = 'game:GetService("Lighting")', Action = function()
  1699. parent = 'game:GetService("Lighting")'
  1700. end},
  1701. }
  1702. if typeScript=="LocalScript" then
  1703. local base = 'game:GetService("Players").LocalPlayer'
  1704. for _, name in ipairs({"PlayerGui", "Backpack", "Character"}) do
  1705. local destination = name
  1706. table.insert(options, {Text = destination, Action = function()
  1707. parent = base .. "." .. destination
  1708. end})
  1709. end
  1710. end
  1711. return options
  1712. end,
  1713. },
  1714. {
  1715. Title = "Please choose what to convert",
  1716. Text = {"Workspace mode clears existing objects when the output runs."},
  1717. Options = function()
  1718. return {
  1719. {Text = "Convert selection", Primary = true, Action = function()
  1720. local selected = SelectionService:Get()
  1721. if #selected==0 then
  1722. return false, "Select at least one object in Explorer first."
  1723. end
  1724. selection = selected
  1725. clearObjects = false
  1726. end},
  1727. {Text = "Convert workspace", Action = function()
  1728. selection = workspace:GetChildren()
  1729. clearObjects = true
  1730. end},
  1731. }
  1732. end,
  1733. },
  1734. }
  1735.  
  1736. showPrompt = function(index, notice)
  1737. local prompt = Prompts[index]
  1738. local rows = {}
  1739. if notice then
  1740. table.insert(rows, {Text = notice, Info = true, Warning = true})
  1741. end
  1742. for _, text in ipairs(prompt.Text or {}) do
  1743. table.insert(rows, {Text = text, Info = true})
  1744. end
  1745. for _, option in ipairs(prompt.Options()) do
  1746. local choice = option
  1747. table.insert(rows, {
  1748. Text = choice.Text,
  1749. Primary = choice.Primary,
  1750. Action = function()
  1751. if choice.Cancel then
  1752. closePrompt()
  1753. return
  1754. end
  1755. local advance, message = choice.Action()
  1756. if advance==false then
  1757. showPrompt(index, message)
  1758. elseif index<#Prompts then
  1759. showPrompt(index+1)
  1760. else
  1761. beginCompilation()
  1762. end
  1763. end,
  1764. })
  1765. end
  1766. renderPage(prompt.Title, ("Model to Script | Step %d of %d"):format(index, #Prompts), rows)
  1767. end
  1768.  
  1769. local function showResult(output)
  1770. renderPage("Conversion complete", "One output script. No size-based splitting.", {
  1771. {Text = ("Created %s (%s) in Workspace."):format(output.Name, output.ClassName), Info = true},
  1772. {Text = "Source written with UpdateSourceAsync().", Info = true},
  1773. {Text = "Open script", Primary = true, Action = function()
  1774. if not output.Parent then
  1775. warn("M2S: the compiled script was removed from the place.")
  1776. return
  1777. end
  1778. SelectionService:Set({output})
  1779. local ok, opened, message = pcall(function()
  1780. return game:GetService("ScriptEditorService"):OpenScriptDocumentAsync(output)
  1781. end)
  1782. if not ok or not opened then
  1783. warn("M2S: could not open the editor: " .. tostring(ok and message or opened))
  1784. end
  1785. end},
  1786. {Text = "Convert another", Action = function()
  1787. resetOptions()
  1788. showPrompt(1)
  1789. end},
  1790. {Text = "Close", Action = closePrompt},
  1791. })
  1792. end
  1793.  
  1794. beginCompilation = function()
  1795. if isCompiling or uiBusy then return end
  1796. if RunService:IsRunning() then
  1797. showPrompt(4, "Stop playtesting before converting; use Studio edit mode.")
  1798. return
  1799. end
  1800. local root = activePrompt
  1801. uiBusy = true
  1802. renderPage("Converting...", "Closing this window does not cancel an active conversion.", {
  1803. {Text = "Building one output script...", Info = true},
  1804. {Text = "Large models may temporarily pause Studio.", Info = true},
  1805. })
  1806. task.spawn(function()
  1807. if disposed or activePrompt~=root then
  1808. uiBusy = false
  1809. return
  1810. end
  1811. local output = Compile()
  1812. uiBusy = false
  1813. if disposed then return end
  1814. if output then
  1815. SelectionService:Set({output})
  1816. end
  1817. if activePrompt~=root then return end
  1818. if output then
  1819. showResult(output)
  1820. else
  1821. renderPage("Conversion failed", "See Studio's Output window for the full error.", {
  1822. {Text = "The converter could not finish. No partial output was kept.", Info = true, Warning = true},
  1823. {Text = "Try again", Primary = true, Action = function() showPrompt(4) end},
  1824. {Text = "Close", Action = closePrompt},
  1825. })
  1826. end
  1827. end)
  1828. end
  1829.  
  1830. local function attachDragging(root)
  1831. local main = root.Main
  1832. local titleBar = main.TitleBar
  1833. local dragging = false
  1834. local dragStart
  1835. local startPosition
  1836. local touchInput
  1837. titleBar.InputBegan:Connect(function(input)
  1838. if input.UserInputType==Enum.UserInputType.MouseButton1 or input.UserInputType==Enum.UserInputType.Touch then
  1839. dragging = true
  1840. dragStart = input.Position
  1841. startPosition = main.Position
  1842. touchInput = input.UserInputType==Enum.UserInputType.Touch and input or nil
  1843. end
  1844. end)
  1845. table.insert(windowConnections, UserInputService.InputChanged:Connect(function(input)
  1846. if not dragging or activePrompt~=root then return end
  1847. if input.UserInputType==Enum.UserInputType.MouseMovement or input==touchInput then
  1848. local delta = input.Position - dragStart
  1849. main.Position = UDim2.new(
  1850. startPosition.X.Scale, startPosition.X.Offset + delta.X,
  1851. startPosition.Y.Scale, startPosition.Y.Offset + delta.Y
  1852. )
  1853. end
  1854. end))
  1855. table.insert(windowConnections, UserInputService.InputEnded:Connect(function(input)
  1856. if input.UserInputType==Enum.UserInputType.MouseButton1 or input==touchInput then
  1857. dragging = false
  1858. end
  1859. end))
  1860. end
  1861.  
  1862. local function openPrompt()
  1863. if disposed then return end
  1864. if activePrompt then return end
  1865. if isCompiling or uiBusy then
  1866. warn("M2S: a conversion is already in progress.")
  1867. return
  1868. end
  1869. resetOptions()
  1870. local newPrompt = promptGui:Clone()
  1871. newPrompt.Name = WINDOW_NAME
  1872. activePrompt = newPrompt
  1873. newPrompt.Main.TitleBar.Exit.Activated:Connect(closePrompt)
  1874. newPrompt.Destroying:Connect(function()
  1875. if activePrompt==newPrompt then
  1876. activePrompt = nil
  1877. disconnectAll(windowConnections)
  1878. windowConnections = {}
  1879. uiBusy = isCompiling
  1880. end
  1881. end)
  1882. attachDragging(newPrompt)
  1883. newPrompt.Parent = CoreGui
  1884. showPrompt(1)
  1885. end
  1886.  
  1887. local function cleanup(initAlreadyDestroying)
  1888. if disposed then return end
  1889. disposed = true
  1890. closePrompt()
  1891. disconnectAll(lifetimeConnections)
  1892. lifetimeConnections = {}
  1893. promptGui:Destroy()
  1894. promptBasis:Destroy()
  1895. optionBasis:Destroy()
  1896. if toolbar then
  1897. pcall(function() toolbar:Destroy() end)
  1898. end
  1899. if not initAlreadyDestroying then
  1900. init:Destroy()
  1901. end
  1902. end
  1903.  
  1904. init.Destroying:Connect(function() cleanup(true) end)
  1905. launcher.Activated:Connect(openPrompt)
  1906.  
  1907. local hidden = false
  1908. if pluginHandle then
  1909. local settingsOK, savedHidden = pcall(function() return pluginHandle:GetSetting("Hidden") end)
  1910. hidden = settingsOK and savedHidden==true
  1911. local toolbarOK, toolbarError = pcall(function()
  1912. toolbar = pluginHandle:CreateToolbar("M2S")
  1913. toolbarButton = toolbar:CreateButton("M2SStandaloneToggle", "Show or hide the M2S launcher", "", "M2S")
  1914. toolbarButton:SetActive(not hidden)
  1915. toolbarButton.Click:Connect(function()
  1916. hidden = not hidden
  1917. launcher.Visible = not hidden
  1918. toolbarButton:SetActive(not hidden)
  1919. pcall(function() pluginHandle:SetSetting("Hidden", hidden) end)
  1920. end)
  1921. end)
  1922. if not toolbarOK then
  1923. hidden = false
  1924. warn("M2S: toolbar unavailable; use the on-screen launcher. " .. tostring(toolbarError))
  1925. end
  1926. table.insert(lifetimeConnections, pluginHandle.Unloading:Connect(function() cleanup(false) end))
  1927. end
  1928. launcher.Visible = not hidden
  1929.  
  1930. -- The Command Bar has no persistent plugin installation; open the wizard now.
  1931. if not pluginHandle then
  1932. openPrompt()
  1933. end
  1934.  
Add Comment
Please, Sign In to add comment