Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 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
- lightingPropertes = {
- "Ambient",
- "Brightness",
- "ColorShift_Bottom",
- "ColorShift_Top",
- "GlobalShadows",
- "OutdoorAmbient",
- "Outlines",
- "GeographicLatitude",
- "TimeOfDay",
- "FogColor",
- "FogEnd",
- "FogStart",
- }
- supportedClasses = {
- ["Accoutrement"] = true,
- ["Accessory"] = true,
- ["Hat"] = true,
- ["Animation"] = true,
- ["AnimationController"] = true,
- ["Beam"] = true,
- ["BindableEvent"] = true,
- ["BindableFunction"] = true,
- ["BodyAngularVelocity"] = true,
- ["BodyForce"] = true,
- ["BodyGyro"] = true,
- ["BodyPosition"] = true,
- ["BodyThrust"] = true,
- ["BodyVelocity"] = true,
- ["RocketPropulsion"] = true,
- ["Camera"] = true,
- ["BodyColors"] = true,
- ["CharacterMesh"] = true,
- ["Pants"] = true,
- ["Shirt"] = true,
- ["ShirtGraphic"] = true,
- ["Skin"] = true,
- ["ClickDetector"] = true,
- ["Configuration"] = true,
- ["AlignOrientation"] = true,
- ["AlignPosition"] = true,
- ["BallSocketConstraint"] = true,
- ["HingeConstraint"] = true,
- ["LineForce"] = true,
- ["RodConstraint"] = true,
- ["RopeConstraint"] = true,
- ["CylindricalConstraint"] = true,
- ["PrismaticConstraint"] = true,
- ["SpringConstraint"] = true,
- ["Torque"] = true,
- ["VectorForce"] = true,
- ["HumanoidController"] = true,
- ["SkateboardController"] = true,
- ["VehicleController"] = true,
- ["CustomEvent"] = true,
- ["CustomEventReceiver"] = true,
- ["BlockMesh"] = true,
- ["CylinderMesh"] = true,
- ["FileMesh"] = true,
- ["SpecialMesh"] = true,
- ["Dialog"] = true,
- ["DialogChoice"] = true,
- ["Explosion"] = true,
- ["Decal"] = true,
- ["Texture"] = true,
- ["Hole"] = true,
- ["MotorFeature"] = true,
- ["Fire"] = true,
- ["FlyweightService"] = true,
- ["CSGDictionaryService"] = true,
- ["NonReplicatedCSGDictionaryService"] = true,
- ["Folder"] = true,
- ["ForceField"] = true,
- ["FunctionalTest"] = true,
- ["Frame"] = true,
- ["ImageButton"] = true,
- ["TextButton"] = true,
- ["ImageLabel"] = true,
- ["TextLabel"] = true,
- ["ScrollingFrame"] = true,
- ["TextBox"] = true,
- ["BillboardGui"] = true,
- ["ScreenGui"] = true,
- ["GuiMain"] = true,
- ["SurfaceGui"] = true,
- ["FloorWire"] = true,
- ["BoxHandleAdornment"] = true,
- ["ConeHandleAdornment"] = true,
- ["CylinderHandleAdornment"] = true,
- ["ImageHandleAdornment"] = true,
- ["LineHandleAdornment"] = true,
- ["SphereHandleAdornment"] = true,
- ["SelectionBox"] = true,
- ["SelectionSphere"] = true,
- ["ArcHandles"] = true,
- ["Handles"] = true,
- ["SurfaceSelection"] = true,
- ["SelectionPartLasso"] = true,
- ["SelectionPointLasso"] = true,
- ["Backpack"] = true,
- ["HopperBin"] = true,
- ["Tool"] = true,
- ["Flag"] = true,
- ["Humanoid"] = true,
- ["RotateP"] = true,
- ["RotateV"] = true,
- ["Glue"] = true,
- ["ManualGlue"] = true,
- ["ManualWeld"] = true,
- ["Motor"] = true,
- ["Motor6D"] = true,
- ["Rotate"] = true,
- ["Snap"] = true,
- ["VelocityMotor"] = true,
- ["Weld"] = true,
- ["Keyframe"] = true,
- ["KeyframeSequence"] = true,
- ["PointLight"] = true,
- ["SpotLight"] = true,
- ["SurfaceLight"] = true,
- ["LocalizationTable"] = true,
- ["Script"] = true,
- ["LocalScript"] = true,
- ["ModuleScript"] = true,
- ["Message"] = true,
- ["Hint"] = true,
- ["CornerWedgePart"] = true,
- ["Part"] = true,
- ["FlagStand"] = true,
- ["Seat"] = true,
- ["SkateboardPlatform"] = true,
- ["SpawnLocation"] = true,
- ["WedgePart"] = true,
- ["MeshPart"] = true,
- ["PartOperation"] = true,
- ["NegateOperation"] = true,
- ["UnionOperation"] = true,
- ["TrussPart"] = true,
- ["VehicleSeat"] = true,
- ["Model"] = true,
- ["PartOperationAsset"] = true,
- ["ParticleEmitter"] = true,
- ["PluginAction"] = true,
- ["Pose"] = true,
- ["BloomEffect"] = true,
- ["BlurEffect"] = true,
- ["ColorCorrectionEffect"] = true,
- ["SunRaysEffect"] = true,
- ["ReflectionMetadata"] = true,
- ["ReflectionMetadataCallbacks"] = true,
- ["ReflectionMetadataClasses"] = true,
- ["ReflectionMetadataEnums"] = true,
- ["ReflectionMetadataEvents"] = true,
- ["ReflectionMetadataFunctions"] = true,
- ["ReflectionMetadataClass"] = true,
- ["ReflectionMetadataEnum"] = true,
- ["ReflectionMetadataEnumItem"] = true,
- ["ReflectionMetadataMember"] = true,
- ["ReflectionMetadataProperties"] = true,
- ["ReflectionMetadataYieldFunctions"] = true,
- ["RemoteEvent"] = true,
- ["RemoteFunction"] = true,
- ["Sky"] = true,
- ["Smoke"] = true,
- ["Sound"] = true,
- ["ChorusSoundEffect"] = true,
- ["CompressorSoundEffect"] = true,
- ["DistortionSoundEffect"] = true,
- ["EchoSoundEffect"] = true,
- ["EqualizerSoundEffect"] = true,
- ["FlangeSoundEffect"] = true,
- ["PitchShiftSoundEffect"] = true,
- ["ReverbSoundEffect"] = true,
- ["TremoloSoundEffect"] = true,
- ["SoundGroup"] = true,
- ["Sparkles"] = true,
- ["StarterGear"] = true,
- ["StarterPlayerScripts"] = true,
- ["StarterCharacterScripts"] = true,
- ["Team"] = true,
- ["TerrainRegion"] = true,
- ["TestService"] = true,
- ["Trail"] = true,
- ["Tween"] = true,
- ["UIAspectRatioConstraint"] = true,
- ["UISizeConstraint"] = true,
- ["UITextSizeConstraint"] = true,
- ["UIGridLayout"] = true,
- ["UIListLayout"] = true,
- ["UIPageLayout"] = true,
- ["UITableLayout"] = true,
- ["UIPadding"] = true,
- ["UIScale"] = true,
- ["BinaryStringValue"] = true,
- ["BoolValue"] = true,
- ["BrickColorValue"] = true,
- ["CFrameValue"] = true,
- ["Color3Value"] = true,
- ["DoubleConstrainedValue"] = true,
- ["IntConstrainedValue"] = true,
- ["IntValue"] = true,
- ["NumberValue"] = true,
- ["ObjectValue"] = true,
- ["RayValue"] = true,
- ["StringValue"] = true,
- ["Vector3Value"] = true,
- ["VirtualInputManager"] = true,
- ["WeldConstraint"] = true,
- }
- supportedProperties = {
- "Archivable",
- "ClassName",
- "DataCost",
- "Name",
- "Parent",
- "RobloxLocked",
- "archivable",
- "className",
- "AttachmentForward",
- "AttachmentPoint",
- "AttachmentPos",
- "AttachmentRight",
- "AttachmentUp",
- "AnimationId",
- "Animation",
- "IsPlaying",
- "Length",
- "Looped",
- "Priority",
- "Speed",
- "TimePosition",
- "WeightCurrent",
- "WeightTarget",
- "Axis",
- "CFrame",
- "Orientation",
- "Position",
- "Rotation",
- "SecondaryAxis",
- "Visible",
- "WorldAxis",
- "WorldCFrame",
- "WorldOrientation",
- "WorldPosition",
- "WorldRotation",
- "WorldSecondaryAxis",
- "SelectionImageObject",
- "Version",
- "CurrentScreenOrientation",
- "ScreenOrientation",
- "ProcessUserInput",
- "ResetPlayerGuiOnSpawn",
- "ShowDevelopmentGui",
- "Attachment0",
- "Attachment1",
- "Color",
- "CurveSize0",
- "CurveSize1",
- "Enabled",
- "FaceCamera",
- "LightEmission",
- "LightInfluence",
- "Segments",
- "Texture",
- "TextureLength",
- "TextureMode",
- "TextureSpeed",
- "Transparency",
- "Width0",
- "Width1",
- "ZOffset",
- "AngularVelocity",
- "MaxTorque",
- "P",
- "angularvelocity",
- "maxTorque",
- "Force",
- "force",
- "D",
- "cframe",
- "MaxForce",
- "maxForce",
- "position",
- "Location",
- "location",
- "Velocity",
- "velocity",
- "CartoonFactor",
- "MaxSpeed",
- "MaxThrust",
- "Target",
- "TargetOffset",
- "TargetRadius",
- "ThrustD",
- "ThrustP",
- "TurnD",
- "TurnP",
- "ClickableWhenViewportHidden",
- "Icon",
- "CameraSubject",
- "CameraType",
- "CoordinateFrame",
- "FieldOfView",
- "Focus",
- "HeadLocked",
- "HeadScale",
- "NearPlaneZ",
- "ViewportSize",
- "focus",
- "HeadColor",
- "HeadColor3",
- "LeftArmColor",
- "LeftArmColor3",
- "LeftLegColor",
- "LeftLegColor3",
- "RightArmColor",
- "RightArmColor3",
- "RightLegColor",
- "RightLegColor3",
- "TorsoColor",
- "TorsoColor3",
- "BaseTextureId",
- "BodyPart",
- "MeshId",
- "OverlayTextureId",
- "PantsTemplate",
- "ShirtTemplate",
- "Graphic",
- "SkinColor",
- "LoadDefaultChat",
- "CursorIcon",
- "MaxActivationDistance",
- "MaxAngularVelocity",
- "PrimaryAxisOnly",
- "ReactionTorqueEnabled",
- "Responsiveness",
- "RigidityEnabled",
- "ApplyAtCenterOfMass",
- "MaxVelocity",
- "ReactionForceEnabled",
- "LimitsEnabled",
- "Radius",
- "Restitution",
- "TwistLimitsEnabled",
- "TwistLowerAngle",
- "TwistUpperAngle",
- "UpperAngle",
- "ActuatorType",
- "AngularSpeed",
- "CurrentAngle",
- "LowerAngle",
- "MotorMaxAcceleration",
- "MotorMaxTorque",
- "ServoMaxTorque",
- "TargetAngle",
- "InverseSquareLaw",
- "Magnitude",
- "CurrentDistance",
- "Thickness",
- "CurrentPosition",
- "LowerLimit",
- "MotorMaxForce",
- "ServoMaxForce",
- "Size",
- "TargetPosition",
- "UpperLimit",
- "AngularActuatorType",
- "AngularLimitsEnabled",
- "AngularRestitution",
- "InclinationAngle",
- "MotorMaxAngularAcceleration",
- "RotationAxisVisible",
- "WorldRotationAxis",
- "Coils",
- "CurrentLength",
- "Damping",
- "FreeLength",
- "MaxLength",
- "MinLength",
- "Stiffness",
- "RelativeTo",
- "Torque",
- "BaseUrl",
- "RequestQueueSize",
- "Steer",
- "Throttle",
- "Source",
- "Offset",
- "Scale",
- "VertexColor",
- "TextureId",
- "MeshType",
- "AutomaticRetry",
- "LegacyNamingScheme",
- "MaxItems",
- "DataModel",
- "ErrorReporting",
- "GfxCard",
- "InstanceCount",
- "IsFmodProfilingEnabled",
- "IsScriptStackTracingEnabled",
- "JobCount",
- "LuaRamLimit",
- "OsIs64Bit",
- "OsPlatform",
- "OsPlatformId",
- "OsVer",
- "PlayerCount",
- "ReportSoundWarnings",
- "RobloxProductName",
- "RobloxVersion",
- "SIMD",
- "SystemProductName",
- "TickCountPreciseOverride",
- "VideoMemory",
- "Condition",
- "IsEnabled",
- "Line",
- "DebuggingEnabled",
- "Expression",
- "BehaviorType",
- "ConversationDistance",
- "GoodbyeChoiceActive",
- "GoodbyeDialog",
- "InUse",
- "InitialPrompt",
- "Purpose",
- "Tone",
- "TriggerDistance",
- "TriggerOffset",
- "ResponseDialog",
- "UserDialog",
- "BlastPressure",
- "BlastRadius",
- "DestroyJointRadiusPercent",
- "ExplosionType",
- "Face",
- "Color3",
- "LocalTransparencyModifier",
- "Shiny",
- "Specular",
- "StudsPerTileU",
- "StudsPerTileV",
- "FaceId",
- "InOut",
- "LeftRight",
- "TopBottom",
- "Heat",
- "SecondaryColor",
- "size",
- "Description",
- "AdditionalCoreIncludeDirs",
- "BubbleChatLifetime",
- "BubbleChatMaxBubbles",
- "ChatHistory",
- "ChatScrollLength",
- "CollisionSoundEnabled",
- "CollisionSoundVolume",
- "HardwareMouse",
- "MaxCollisionSounds",
- "OverrideStarterScript",
- "ReportAbuseChatHistory",
- "SoftwareSound",
- "VideoCaptureEnabled",
- "VideoQuality",
- "AbsolutePosition",
- "AbsoluteRotation",
- "AbsoluteSize",
- "AutoLocalize",
- "Localize",
- "RootLocalizationTable",
- "Active",
- "AnchorPoint",
- "BackgroundColor",
- "BackgroundColor3",
- "BackgroundTransparency",
- "BorderColor",
- "BorderColor3",
- "BorderSizePixel",
- "ClipsDescendants",
- "Draggable",
- "LayoutOrder",
- "NextSelectionDown",
- "NextSelectionLeft",
- "NextSelectionRight",
- "NextSelectionUp",
- "Selectable",
- "SizeConstraint",
- "SizeFromContents",
- "ZIndex",
- "Style",
- "AutoButtonColor",
- "Modal",
- "Selected",
- "Image",
- "ImageColor3",
- "ImageRectOffset",
- "ImageRectSize",
- "ImageTransparency",
- "IsLoaded",
- "ScaleType",
- "SliceCenter",
- "TileSize",
- "Font",
- "FontSize",
- "LineHeight",
- "LocalizedText",
- "Text",
- "TextBounds",
- "TextColor",
- "TextColor3",
- "TextFits",
- "TextScaled",
- "TextSize",
- "TextStrokeColor3",
- "TextStrokeTransparency",
- "TextTransparency",
- "TextTruncate",
- "TextWrap",
- "TextWrapped",
- "TextXAlignment",
- "TextYAlignment",
- "ScaleEdgeSize",
- "SlicePrefix",
- "AbsoluteWindowSize",
- "BottomImage",
- "CanvasPosition",
- "CanvasSize",
- "ElasticBehavior",
- "HorizontalScrollBarInset",
- "MidImage",
- "ScrollBarThickness",
- "ScrollingDirection",
- "ScrollingEnabled",
- "TopImage",
- "VerticalScrollBarInset",
- "VerticalScrollBarPosition",
- "ClearTextOnFocus",
- "ManualFocusRelease",
- "MultiLine",
- "OverlayNativeInput",
- "PlaceholderColor3",
- "PlaceholderText",
- "ShowNativeInput",
- "ResetOnSpawn",
- "ZIndexBehavior",
- "Adornee",
- "AlwaysOnTop",
- "ExtentsOffset",
- "ExtentsOffsetWorldSpace",
- "MaxDistance",
- "PlayerToHideFrom",
- "SizeOffset",
- "StudsOffset",
- "StudsOffsetWorldSpace",
- "HostWidgetWasRestored",
- "Title",
- "DisplayOrder",
- "ToolPunchThroughDistance",
- "CycleOffset",
- "From",
- "StudsBetweenTextures",
- "TextureSize",
- "To",
- "WireRadius",
- "SizeRelativeOffset",
- "Height",
- "A",
- "B",
- "C",
- "Range",
- "LineThickness",
- "SurfaceColor",
- "SurfaceColor3",
- "SurfaceTransparency",
- "Axes",
- "Faces",
- "TargetSurface",
- "Humanoid",
- "Part",
- "Point",
- "BinType",
- "CanBeDropped",
- "Grip",
- "GripForward",
- "GripPos",
- "GripRight",
- "GripUp",
- "ManualActivationOnly",
- "RequiresHandle",
- "ToolTip",
- "TeamColor",
- "AutoSelectGuiEnabled",
- "CoreEffectFolder",
- "CoreGuiFolder",
- "CoreGuiNavigationEnabled",
- "GuiNavigationEnabled",
- "IsModalDialog",
- "IsWindows",
- "MenuIsOpen",
- "SelectedCoreObject",
- "SelectedObject",
- "HttpEnabled",
- "AutoJumpEnabled",
- "AutoRotate",
- "CameraOffset",
- "DisplayDistanceType",
- "FloorMaterial",
- "Health",
- "HealthDisplayDistance",
- "HealthDisplayType",
- "HipHeight",
- "Jump",
- "JumpPower",
- "LeftLeg",
- "MaxHealth",
- "MaxSlopeAngle",
- "MoveDirection",
- "NameDisplayDistance",
- "NameOcclusion",
- "PlatformStand",
- "RigType",
- "RightLeg",
- "RootPart",
- "SeatPart",
- "Sit",
- "TargetPoint",
- "Torso",
- "WalkSpeed",
- "WalkToPart",
- "WalkToPoint",
- "maxHealth",
- "Delta",
- "KeyCode",
- "UserInputState",
- "UserInputType",
- "AllowInsertFreeModels",
- "C0",
- "C1",
- "Part0",
- "Part1",
- "part1",
- "BaseAngle",
- "F0",
- "F1",
- "F2",
- "F3",
- "DesiredAngle",
- "Transform",
- "Hole",
- "Time",
- "Loop",
- "Brightness",
- "Shadows",
- "Angle",
- "Ambient",
- "ClockTime",
- "ColorShift_Bottom",
- "ColorShift_Top",
- "FogColor",
- "FogEnd",
- "FogStart",
- "GeographicLatitude",
- "GlobalShadows",
- "OutdoorAmbient",
- "Outlines",
- "ShadowColor",
- "TimeOfDay",
- "ForcePlayModeRobloxLocaleId",
- "IsTextScraperRunning",
- "RobloxForcePlayModeRobloxLocaleId",
- "RobloxLocaleId",
- "SystemLocaleId",
- "DevelopmentLanguage",
- "Root",
- "SourceLocaleId",
- "AreScriptStartsReported",
- "DefaultWaitTime",
- "GcFrequency",
- "GcLimit",
- "GcPause",
- "GcStepMul",
- "WaitingThreadsBudget",
- "Disabled",
- "LinkedSource",
- "Hit",
- "Origin",
- "TargetFilter",
- "UnitRay",
- "ViewSizeX",
- "ViewSizeY",
- "X",
- "Y",
- "hit",
- "target",
- "Ticket",
- "Port",
- "ArePhysicsRejectionsReported",
- "ClientPhysicsSendRate",
- "DataGCRate",
- "DataMtuAdjust",
- "DataSendPriority",
- "DataSendRate",
- "ExtraMemoryUsed",
- "FreeMemoryMBytes",
- "IncommingReplicationLag",
- "IsQueueErrorComputed",
- "NetworkOwnerRate",
- "PhysicsMtuAdjust",
- "PhysicsSendPriority",
- "PhysicsSendRate",
- "PreferredClientPort",
- "PrintBits",
- "PrintEvents",
- "PrintFilters",
- "PrintInstances",
- "PrintPhysicsErrors",
- "PrintProperties",
- "PrintSplitMessage",
- "PrintStreamInstanceQuota",
- "PrintTouches",
- "ReceiveRate",
- "RenderStreamedRegions",
- "ShowActiveAnimationAsset",
- "TouchSendRate",
- "TrackDataTypes",
- "TrackPhysicsDetails",
- "UseInstancePacketCache",
- "UsePhysicsPacketCache",
- "Anchored",
- "BackParamA",
- "BackParamB",
- "BackSurface",
- "BackSurfaceInput",
- "BottomParamA",
- "BottomParamB",
- "BottomSurface",
- "BottomSurfaceInput",
- "BrickColor",
- "CanCollide",
- "CenterOfMass",
- "CollisionGroupId",
- "CustomPhysicalProperties",
- "Elasticity",
- "Friction",
- "FrontParamA",
- "FrontParamB",
- "FrontSurface",
- "FrontSurfaceInput",
- "LeftParamA",
- "LeftParamB",
- "LeftSurface",
- "LeftSurfaceInput",
- "Locked",
- "Material",
- "ReceiveAge",
- "Reflectance",
- "ResizeIncrement",
- "ResizeableFaces",
- "RightParamA",
- "RightParamB",
- "RightSurface",
- "RightSurfaceInput",
- "RotVelocity",
- "SpecificGravity",
- "TopParamA",
- "TopParamB",
- "TopSurface",
- "TopSurfaceInput",
- "brickColor",
- "FormFactor",
- "formFactor",
- "Shape",
- "Occupant",
- "Controller",
- "ControllingHumanoid",
- "StickyWheels",
- "AllowTeamChangeOnTouch",
- "Duration",
- "Neutral",
- "TextureID",
- "TriangleCount",
- "UsePartColor",
- "IsSmooth",
- "MaxExtents",
- "WaterColor",
- "WaterReflectance",
- "WaterTransparency",
- "WaterWaveSize",
- "WaterWaveSpeed",
- "AreHingesDetected",
- "HeadsUpDisplay",
- "SteerFloat",
- "ThrottleFloat",
- "TurnSpeed",
- "PrimaryPart",
- "AllowThirdPartySales",
- "CurrentCamera",
- "DistributedGameTime",
- "FallenPartsDestroyHeight",
- "FilteringEnabled",
- "Gravity",
- "StreamingEnabled",
- "Terrain",
- "IsFinished",
- "Acceleration",
- "Drag",
- "EmissionDirection",
- "Lifetime",
- "LockedToPart",
- "Rate",
- "RotSpeed",
- "SpreadAngle",
- "VelocityInheritance",
- "VelocitySpread",
- "Status",
- "EmptyCutoff",
- "AllowSleep",
- "AreAnchorsShown",
- "AreAssembliesShown",
- "AreAwakePartsHighlighted",
- "AreBodyTypesShown",
- "AreContactIslandsShown",
- "AreContactPointsShown",
- "AreJointCoordinatesShown",
- "AreMechanismsShown",
- "AreModelCoordsShown",
- "AreOwnersShown",
- "ArePartCoordsShown",
- "AreRegionsShown",
- "AreUnalignedPartsShown",
- "AreWorldCoordsShown",
- "DisableCSGv2",
- "IsReceiveAgeShown",
- "IsTreeShown",
- "ParallelPhysics",
- "PhysicsAnalyzerEnabled",
- "PhysicsEnvironmentalThrottle",
- "ShowDecompositionGeometry",
- "ThrottleAdjustTime",
- "UseCSGv2",
- "AccountAge",
- "AppearanceDidLoad",
- "CameraMaxZoomDistance",
- "CameraMinZoomDistance",
- "CameraMode",
- "CanLoadCharacterAppearance",
- "Character",
- "CharacterAppearance",
- "CharacterAppearanceId",
- "ChatMode",
- "DataComplexity",
- "DataComplexityLimit",
- "DataReady",
- "DevCameraOcclusionMode",
- "DevComputerCameraMode",
- "DevComputerMovementMode",
- "DevEnableMouseLock",
- "DevTouchCameraMode",
- "DevTouchMovementMode",
- "DisplayName",
- "FollowUserId",
- "Guest",
- "LocaleId",
- "MaximumSimulationRadius",
- "MembershipType",
- "ReplicationFocus",
- "RespawnLocation",
- "SimulationRadius",
- "Team",
- "Teleported",
- "TeleportedIn",
- "UserId",
- "VRDevice",
- "userId",
- "BubbleChat",
- "CharacterAutoLoads",
- "ClassicChat",
- "LocalPlayer",
- "MaxPlayers",
- "MaxPlayersInternal",
- "NumPlayers",
- "PreferredPlayers",
- "PreferredPlayersInternal",
- "localPlayer",
- "numPlayers",
- "CollisionEnabled",
- "GridSize",
- "ActionId",
- "StatusTip",
- "EasingDirection",
- "EasingStyle",
- "MaskWeight",
- "Weight",
- "Intensity",
- "Threshold",
- "Contrast",
- "Saturation",
- "TintColor",
- "Spread",
- "Browsable",
- "ClassCategory",
- "Constraint",
- "Deprecated",
- "EditingDisabled",
- "IsBackend",
- "ScriptContext",
- "UIMaximum",
- "UIMinimum",
- "UINumTicks",
- "summary",
- "ExplorerImageIndex",
- "ExplorerOrder",
- "Insertable",
- "PreferredParent",
- "AutoFRMLevel",
- "EagerBulkExecution",
- "EditQualityLevel",
- "EnableFRM",
- "ExportMergeByMaterial",
- "FrameRateManager",
- "GraphicsMode",
- "MeshCacheSize",
- "QualityLevel",
- "ReloadAssets",
- "RenderCSGTrianglesDebug",
- "ShowBoundingBoxes",
- "ScriptsDisabled",
- "CurrentLine",
- "IsDebugging",
- "IsPaused",
- "Script",
- "CreatorId",
- "CreatorType",
- "GameId",
- "GearGenreSetting",
- "Genre",
- "IsSFFlagsLoaded",
- "JobId",
- "PlaceId",
- "PlaceVersion",
- "VIPServerId",
- "VIPServerOwnerId",
- "Workspace",
- "lighting",
- "workspace",
- "CelestialBodiesShown",
- "MoonAngularSize",
- "MoonTextureId",
- "SkyboxBk",
- "SkyboxDn",
- "SkyboxFt",
- "SkyboxLf",
- "SkyboxRt",
- "SkyboxUp",
- "StarCount",
- "SunAngularSize",
- "SunTextureId",
- "Opacity",
- "RiseVelocity",
- "EmitterSize",
- "MinDistance",
- "Pitch",
- "PlayOnRemove",
- "PlaybackLoudness",
- "PlaybackSpeed",
- "Playing",
- "RollOffMode",
- "SoundGroup",
- "SoundId",
- "TimeLength",
- "Volume",
- "isPlaying",
- "Depth",
- "Mix",
- "Attack",
- "GainMakeup",
- "Ratio",
- "Release",
- "SideChain",
- "Level",
- "Delay",
- "DryLevel",
- "Feedback",
- "WetLevel",
- "HighGain",
- "LowGain",
- "MidGain",
- "Octave",
- "DecayTime",
- "Density",
- "Diffusion",
- "Duty",
- "Frequency",
- "AmbientReverb",
- "DistanceFactor",
- "DopplerScale",
- "RespectFilteringEnabled",
- "RolloffScale",
- "SparkleColor",
- "AllowCustomAnimations",
- "DevComputerCameraMovementMode",
- "DevTouchCameraMovementMode",
- "EnableMouseLockOption",
- "LoadCharacterAppearance",
- "ContactsCount",
- "DataReceiveKbps",
- "DataSendKbps",
- "HeartbeatTimeMs",
- "MovingPrimitivesCount",
- "PhysicsReceiveKbps",
- "PhysicsSendKbps",
- "PhysicsStepTimeMs",
- "PrimitivesCount",
- "SchedulerDutyCycle",
- "SchedulerRate",
- "ThreadPoolConfig",
- "ThreadPoolSize",
- "AutoAssignable",
- "AutoColorCharacters",
- "Score",
- "CustomizedTeleportUI",
- "SizeInCells",
- "AutoRuns",
- "ErrorCount",
- "ExecuteWithStudioRun",
- "Is30FpsThrottleEnabled",
- "IsPhysicsEnvironmentalThrottled",
- "IsSleepAllowed",
- "NumberOfPlayers",
- "SimulateSecondsLag",
- "TestCount",
- "Timeout",
- "WarnCount",
- "WidthScale",
- "PlaybackState",
- "Instance",
- "TweenInfo",
- "AspectRatio",
- "AspectType",
- "DominantAxis",
- "MaxSize",
- "MinSize",
- "MaxTextSize",
- "MinTextSize",
- "AbsoluteContentSize",
- "FillDirection",
- "HorizontalAlignment",
- "SortOrder",
- "VerticalAlignment",
- "CellPadding",
- "CellSize",
- "FillDirectionMaxCells",
- "StartCorner",
- "Padding",
- "Animated",
- "Circular",
- "CurrentPage",
- "GamepadInputEnabled",
- "ScrollWheelInputEnabled",
- "TouchInputEnabled",
- "TweenTime",
- "FillEmptySpaceColumns",
- "FillEmptySpaceRows",
- "MajorAxis",
- "PaddingBottom",
- "PaddingLeft",
- "PaddingRight",
- "PaddingTop",
- "AllTutorialsDisabled",
- "CameraYInverted",
- "ChatVisible",
- "ComputerCameraMovementMode",
- "ComputerMovementMode",
- "ControlMode",
- "Fullscreen",
- "GamepadCameraSensitivity",
- "HasEverUsedVR",
- "IsUsingCameraYInverted",
- "IsUsingGamepadCameraSensitivity",
- "MasterVolume",
- "MicroProfilerEnabled",
- "MicroProfilerWebServerEnabled",
- "MicroProfilerWebServerIP",
- "MicroProfilerWebServerPort",
- "MouseSensitivity",
- "MouseSensitivityFirstPerson",
- "MouseSensitivityThirdPerson",
- "OnboardingsCompleted",
- "PerformanceStatsVisible",
- "RotationType",
- "SavedQualityLevel",
- "TouchCameraMovementMode",
- "TouchMovementMode",
- "UsedCoreGuiIsVisibleToggle",
- "UsedCustomGuiIsVisibleToggle",
- "UsedHideHudShortcut",
- "VREnabled",
- "VRRotationIntensity",
- "AccelerometerEnabled",
- "BottomBarSize",
- "GamepadEnabled",
- "GazeSelectionEnabled",
- "GyroscopeEnabled",
- "KeyboardEnabled",
- "LegacyInputEventsEnabled",
- "ModalEnabled",
- "MouseBehavior",
- "MouseDeltaSensitivity",
- "MouseEnabled",
- "MouseIconEnabled",
- "NavBarSize",
- "OnScreenKeyboardAnimationDuration",
- "OnScreenKeyboardPosition",
- "OnScreenKeyboardSize",
- "OnScreenKeyboardVisible",
- "OverrideMouseIconBehavior",
- "StatusBarSize",
- "TouchEnabled",
- "UserHeadCFrame",
- "GuiInputUserCFrame",
- "VRDeviceName",
- "Value",
- "ConstrainedValue",
- "MaxValue",
- "MinValue",
- "AdditionalLuaState",
- }
- local count = 0
- local vars = {
- }
- function supported(obj)
- if supportedClasses[obj.className] then
- return true
- end
- return false
- end
- function propertyExists(udata,property)
- local ret,def = pcall(function() return udata[property] end)
- local e = Instance.new(udata.className,nil)
- local ret1,def = pcall(function() e[property] = udata[property] end)
- if e:IsA("GuiObject") and property=="Transparency" then return false end
- e:Destroy()
- return (ret and ret1)
- end
- function getVariable(obj)
- return vars[obj]
- end
- function assignVariable(obj)
- vars[obj] = ("%s%s"):format(obj.className,count)
- count = count + 1
- return vars[obj]
- end
- function serializeProperty(prop)
- if typeof(prop)=="Vector2" or typeof(prop) == "Vector3" or typeof(prop) == "UDim" or typeof(prop)=="Color3" or typeof(prop)=="CFrame" then
- return ("%s.new(%s)"):format(typeof(prop),tostring(prop))
- elseif typeof(prop)=="BrickColor" then
- return ("BrickColor.new(\"%s\")"):format(tostring(prop))
- elseif typeof(prop)=="UDim2" then
- return ("UDim2.new(%s, %s)"):format(tostring(prop.X),tostring(prop.Y))
- elseif typeof(prop)=="Instance" then
- return tostring(vars[prop])
- elseif typeof(prop)=="string" then
- return ("\"%s\""):format(prop)
- elseif typeof(prop)=="NumberRange" then
- return ("NumberRange.new(%s, %s)"):format(prop.Min,prop.Max)
- elseif typeof(prop)=="Faces" then
- local tr = {}
- if prop.Top==true then
- table.insert(tr,tostring(Enum.NormalId.Top))
- end
- if prop.Bottom==true then
- table.insert(tr,tostring(Enum.NormalId.Bottom))
- end
- if prop.Back==true then
- table.insert(tr,tostring(Enum.NormalId.Back))
- end
- if prop.Front==true then
- table.insert(tr,tostring(Enum.NormalId.Front))
- end
- if prop.Right==true then
- table.insert(tr,tostring(Enum.NormalId.Right))
- end
- if prop.Left==true then
- table.insert(tr,tostring(Enum.NormalId.Left))
- end
- return ("Faces.new(%s)"):format(table.concat(tr,","))
- elseif typeof(prop)=="Axes" then
- local tr = {}
- if prop.X==true then
- table.insert(tr,tostring(Enum.Axis.X))
- end
- if prop.Top==true then
- table.insert(tr,tostring(Enum.NormalId.Top))
- end
- if prop.Bottom==true then
- table.insert(tr,tostring(Enum.NormalId.Bottom))
- end
- if prop.Y==true then
- table.insert(tr,tostring(Enum.Axis.Y))
- end
- if prop.Back==true then
- table.insert(tr,tostring(Enum.NormalId.Back))
- end
- if prop.Front==true then
- table.insert(tr,tostring(Enum.NormalId.Front))
- end
- if prop.Z==true then
- table.insert(tr,tostring(Enum.Axis.Z))
- end
- if prop.Right==true then
- table.insert(tr,tostring(Enum.NormalId.Right))
- end
- if prop.Left==true then
- table.insert(tr,tostring(Enum.NormalId.Left))
- end
- return ("Axes.new(%s)"):format(table.concat(tr,","))
- elseif typeof(prop)=="NumberSequence" or typeof(prop)=="ColorSequence" then
- local tr = {}
- for i,v in pairs(prop.Keypoints) do
- table.insert(tr,serializeProperty(v.Value))
- end
- return ("%s.new(%s)"):format(typeof(prop),table.concat(tr,","))
- elseif typeof(prop)=="Ray" then
- return ("Ray.new(%s,%s)"):format(serializeProperty(prop.Origin),serializeProperty(prop.Direction))
- end
- return tostring(prop)
- end
- function isChanged(obj,prop)
- local test = Instance.new(obj.className)
- local bool = obj[prop]==test[prop]
- test:Destroy()
- return not bool
- end
- function createDeclaration(obj)
- local var = assignVariable(obj)
- return ("%s = Instance.new(\"%s\")"):format(var,obj.className)
- end
- function createFunction(var,source)
- local s = "table.insert(cors,sandbox(%s,function()\n%s\nend))"
- return s:format(var,source)
- end
- function serializeObjectProperties(obj)
- local var = getVariable(obj)
- if var~=nil then
- local strs = {}
- for i,v in pairs(supportedProperties) do
- if v=="Source" then
- -- Read the editor's current text, including any open draft.
- -- Do not probe Source by assigning it on a temporary script.
- if obj:IsA("LuaSourceContainer") then
- local source = game:GetService("ScriptEditorService"):GetEditorSource(obj)
- if source~="" then
- table.insert(strs,createFunction(var,source))
- end
- end
- elseif propertyExists(obj,v) and isChanged(obj,v) then
- if v=="Parent" then
- local str = ("%s.Parent = %s"):format(var,vars[obj.Parent] or "mas")
- table.insert(strs,str)
- else
- local str = ("%s.%s = %s"):format(var,v,serializeProperty(obj[v]))
- table.insert(strs,str)
- end
- end
- end
- return table.concat(strs,"\n")
- end
- return nil
- end
- header = [[
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))]]
- footer = [[
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
- ]]
- local orig_header = header
- local orig_footer = footer
- local parent = "workspace"
- local typeScript = "Script"
- local selection = {}
- tree = function(obj)
- local ret = {}
- local args = {}
- local chil = obj:GetChildren()
- for i,v in pairs(chil) do
- if supported(v) then
- table.insert(ret,v)
- end
- local subTree = tree(v)
- for j,u in pairs(subTree) do
- table.insert(ret,u)
- end
- end
- return ret
- end
- function combine(...)
- local args = {...}
- local ret = args[1] or {}
- for i=2,#args do
- table.insert(ret,args[i])
- end
- return ret
- end
- local clearObjects = false
- local isCompiling = false
- function Compile()
- if isCompiling then
- warn("A conversion is already in progress")
- return nil
- end
- isCompiling = true
- -- Capture this run's options before any yielding operation.
- local selectedObjects = selection
- local outputType = typeScript
- local outputParent = parent
- local shouldClearObjects = clearObjects
- selection = {}
- clearObjects = false
- count = 0
- vars = {}
- local outputScript
- local success, result = pcall(function()
- print("This might take a few minutes, freezing is to be expected")
- task.wait()
- -- One buffer, with no character-based splitting or extra output scripts.
- local sourceParts = {}
- local function concatenate(str)
- if str~=nil then
- table.insert(sourceParts,str)
- end
- end
- local compiledHeader = orig_header
- local compiledFooter = orig_footer
- if outputType=="ModuleScript" then
- compiledHeader = "return function()\n" .. compiledHeader
- compiledFooter = compiledFooter .. "\nend"
- end
- concatenate(compiledHeader)
- local items = {}
- for i,v in pairs(selectedObjects) do
- if supported(v) then table.insert(items,v) end
- local tr = tree(v)
- for j,u in pairs(tr) do
- table.insert(items,u)
- end
- end
- if shouldClearObjects then
- 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")
- end
- for i,v in pairs(items) do
- concatenate(createDeclaration(v))
- end
- for i,v in pairs(items) do
- concatenate(serializeObjectProperties(v))
- end
- 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)
- concatenate(moveObjects)
- concatenate(compiledFooter)
- local source = table.concat(sourceParts,"\n")
- outputScript = Instance.new(outputType)
- outputScript.Name = "CompiledScript"
- -- This callback must not yield and may be retried by Studio.
- -- Build the complete source above, then return the same text each time.
- game:GetService("ScriptEditorService"):UpdateSourceAsync(outputScript,function(_oldSource)
- return source
- end)
- -- Publish only after the source update succeeds.
- outputScript.Parent = workspace
- return outputScript
- end)
- -- Release references and allow another conversion, even after an API error.
- count = 0
- vars = {}
- isCompiling = false
- if not success then
- if outputScript then
- outputScript:Destroy()
- end
- warn("Conversion failed: " .. tostring(result))
- return nil
- end
- print("done")
- return result
- end
- -- SELF-CONTAINED UI
- -- Every GUI object below is created in code. No children of script are required.
- local CoreGui = game:GetService("CoreGui")
- local SelectionService = game:GetService("Selection")
- local UserInputService = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local pluginHandle = plugin -- nil is supported when running from the Command Bar.
- if not RunService:IsStudio() then
- error("M2S must run in Roblox Studio, as a plugin or from the Command Bar.", 0)
- end
- local INIT_NAME = "M2S_Standalone_Init"
- local WINDOW_NAME = "M2S_Standalone_ConverterGui"
- -- Rerunning from the Command Bar replaces this tool's previous UI.
- for _, name in ipairs({INIT_NAME, WINDOW_NAME}) do
- local previous = CoreGui:FindFirstChild(name)
- if previous then
- previous:Destroy()
- end
- end
- local colors = {
- Window = Color3.fromRGB(43, 45, 50),
- Title = Color3.fromRGB(30, 32, 36),
- Button = Color3.fromRGB(62, 65, 72),
- Primary = Color3.fromRGB(40, 104, 184),
- Border = Color3.fromRGB(84, 87, 94),
- Text = Color3.fromRGB(242, 243, 245),
- Muted = Color3.fromRGB(188, 193, 202),
- Warning = Color3.fromRGB(244, 204, 117),
- Close = Color3.fromRGB(130, 55, 55),
- }
- local function make(className, properties, objectParent)
- local object = Instance.new(className)
- for property, value in pairs(properties) do
- object[property] = value
- end
- object.Parent = objectParent
- return object
- end
- local function disconnectAll(connections)
- for _, connection in ipairs(connections) do
- connection:Disconnect()
- end
- end
- -- ConverterGui > Main > Holder / TitleBar > Exit / Title, as in the old plugin.
- -- These are unparented templates, not assets that must be installed separately.
- local promptGui = make("ScreenGui", {
- Name = "ConverterGui",
- ResetOnSpawn = false,
- IgnoreGuiInset = false,
- DisplayOrder = 101,
- ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
- })
- local mainTemplate = make("Frame", {
- Name = "Main",
- AnchorPoint = Vector2.new(0.5, 0.5),
- Position = UDim2.new(0.5, 0, 0.5, 0),
- Size = UDim2.new(1, -32, 1, -32),
- BackgroundColor3 = colors.Window,
- BorderColor3 = colors.Border,
- BorderSizePixel = 1,
- Active = true,
- }, promptGui)
- make("UISizeConstraint", {
- MinSize = Vector2.new(280, 230),
- MaxSize = Vector2.new(490, 356),
- }, mainTemplate)
- local titleBarTemplate = make("Frame", {
- Name = "TitleBar",
- Size = UDim2.new(1, 0, 0, 38),
- BackgroundColor3 = colors.Title,
- BorderSizePixel = 0,
- Active = true,
- }, mainTemplate)
- make("TextLabel", {
- Name = "Title",
- Position = UDim2.new(0, 12, 0, 0),
- Size = UDim2.new(1, -60, 1, 0),
- BackgroundTransparency = 1,
- Font = Enum.Font.SourceSansSemibold,
- Text = "Model to Script",
- TextSize = 18,
- TextColor3 = colors.Text,
- TextXAlignment = Enum.TextXAlignment.Left,
- TextTruncate = Enum.TextTruncate.AtEnd,
- }, titleBarTemplate)
- make("TextButton", {
- Name = "Exit",
- AnchorPoint = Vector2.new(1, 0),
- Position = UDim2.new(1, 0, 0, 0),
- Size = UDim2.new(0, 40, 1, 0),
- BackgroundColor3 = colors.Close,
- BorderSizePixel = 0,
- Font = Enum.Font.SourceSansSemibold,
- Text = "X",
- TextSize = 18,
- TextColor3 = colors.Text,
- AutoButtonColor = true,
- }, titleBarTemplate)
- make("Frame", {
- Name = "Holder",
- Position = UDim2.new(0, 12, 0, 50),
- Size = UDim2.new(1, -24, 1, -88),
- BackgroundTransparency = 1,
- BorderSizePixel = 0,
- ClipsDescendants = true,
- }, mainTemplate)
- make("TextLabel", {
- Name = "Footer",
- Position = UDim2.new(0, 12, 1, -28),
- Size = UDim2.new(1, -24, 0, 20),
- BackgroundTransparency = 1,
- Font = Enum.Font.SourceSans,
- Text = "Model to Script",
- TextSize = 13,
- TextColor3 = colors.Muted,
- TextXAlignment = Enum.TextXAlignment.Left,
- TextTruncate = Enum.TextTruncate.AtEnd,
- }, mainTemplate)
- -- Prompt > UIGridLayout and OptionButton are also rebuilt entirely in code.
- local promptBasis = make("ScrollingFrame", {
- Name = "Prompt",
- Size = UDim2.new(1, 0, 1, 0),
- BackgroundTransparency = 1,
- BorderSizePixel = 0,
- CanvasSize = UDim2.new(0, 0, 0, 0),
- AutomaticCanvasSize = Enum.AutomaticSize.Y,
- ScrollingDirection = Enum.ScrollingDirection.Y,
- ScrollBarThickness = 6,
- ScrollBarImageColor3 = colors.Muted,
- })
- make("UIGridLayout", {
- Name = "UIGridLayout",
- CellSize = UDim2.new(1, -10, 0, 38),
- CellPadding = UDim2.new(0, 0, 0, 7),
- FillDirection = Enum.FillDirection.Horizontal,
- FillDirectionMaxCells = 1,
- SortOrder = Enum.SortOrder.LayoutOrder,
- HorizontalAlignment = Enum.HorizontalAlignment.Left,
- VerticalAlignment = Enum.VerticalAlignment.Top,
- }, promptBasis)
- local optionBasis = make("TextButton", {
- Name = "OptionButton",
- Size = UDim2.new(1, 0, 0, 38),
- BackgroundColor3 = colors.Button,
- BorderSizePixel = 0,
- Font = Enum.Font.SourceSans,
- Text = "Option",
- TextSize = 16,
- TextColor3 = colors.Text,
- TextWrapped = true,
- AutoButtonColor = true,
- })
- -- Init > Open: the small launcher that the M2S toolbar button toggles.
- local init = make("ScreenGui", {
- Name = INIT_NAME,
- ResetOnSpawn = false,
- IgnoreGuiInset = false,
- DisplayOrder = 100,
- ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
- }, CoreGui)
- local launcher = make("TextButton", {
- Name = "Open",
- Position = UDim2.new(0, 12, 0, 56),
- Size = UDim2.new(0, 140, 0, 34),
- BackgroundColor3 = colors.Title,
- BorderColor3 = colors.Border,
- BorderSizePixel = 1,
- Font = Enum.Font.SourceSansSemibold,
- Text = "Open M2S",
- TextSize = 16,
- TextColor3 = colors.Text,
- AutoButtonColor = true,
- }, init)
- local activePrompt
- local uiBusy = false
- local disposed = false
- local windowConnections = {}
- local lifetimeConnections = {}
- local toolbar
- local toolbarButton
- local function resetOptions()
- typeScript = "Script"
- parent = "workspace"
- selection = {}
- clearObjects = false
- end
- local function closePrompt()
- disconnectAll(windowConnections)
- windowConnections = {}
- local oldPrompt = activePrompt
- activePrompt = nil
- if oldPrompt then
- oldPrompt:Destroy()
- end
- uiBusy = isCompiling
- if not isCompiling then
- resetOptions()
- end
- end
- local function renderPage(titleText, footerText, rows)
- local root = activePrompt
- if disposed or not root then return end
- local main = root.Main
- main.TitleBar.Title.Text = titleText
- main.Footer.Text = footerText
- local previous = main.Holder:FindFirstChild("Prompt")
- if previous then previous:Destroy() end
- local optionFrame = promptBasis:Clone()
- optionFrame.Parent = main.Holder
- for index, row in ipairs(rows) do
- local entry = row
- local button = optionBasis:Clone()
- button.LayoutOrder = index
- button.Text = entry.Text
- if entry.Info then
- button.Name = "Message"
- button.BackgroundTransparency = 1
- button.TextColor3 = entry.Warning and colors.Warning or colors.Muted
- button.TextXAlignment = Enum.TextXAlignment.Left
- button.AutoButtonColor = false
- button.Active = false
- button.Selectable = false
- else
- button.BackgroundColor3 = entry.Primary and colors.Primary or colors.Button
- button.Activated:Connect(function()
- if disposed or activePrompt~=root or uiBusy then return end
- entry.Action()
- end)
- end
- button.Parent = optionFrame
- end
- end
- local showPrompt
- local beginCompilation
- local Prompts = {
- {
- Title = "Terms of service",
- Text = {
- "Do not use this to create inappropriate scripts",
- "The Roblox ToS is expected to be upheld",
- "Do not use this to be abusive on Void SB",
- },
- Options = function()
- return {
- {Text = "Accept", Primary = true, Action = function() end},
- -- Unlike the old script, Decline cancels instead of freezing Studio.
- {Text = "Decline", Cancel = true},
- }
- end,
- },
- {
- Title = "Please select a type of script",
- Options = function()
- return {
- {Text = "Script", Action = function() typeScript = "Script" end},
- {Text = "LocalScript", Action = function() typeScript = "LocalScript" end},
- {Text = "ModuleScript", Action = function() typeScript = "ModuleScript" end},
- }
- end,
- },
- {
- Title = "Please select a parent",
- Options = function()
- local options = {
- {Text = "workspace", Action = function() parent = "workspace" end},
- {Text = "script", Action = function() parent = "script" end},
- {Text = 'game:GetService("Lighting")', Action = function()
- parent = 'game:GetService("Lighting")'
- end},
- }
- if typeScript=="LocalScript" then
- local base = 'game:GetService("Players").LocalPlayer'
- for _, name in ipairs({"PlayerGui", "Backpack", "Character"}) do
- local destination = name
- table.insert(options, {Text = destination, Action = function()
- parent = base .. "." .. destination
- end})
- end
- end
- return options
- end,
- },
- {
- Title = "Please choose what to convert",
- Text = {"Workspace mode clears existing objects when the output runs."},
- Options = function()
- return {
- {Text = "Convert selection", Primary = true, Action = function()
- local selected = SelectionService:Get()
- if #selected==0 then
- return false, "Select at least one object in Explorer first."
- end
- selection = selected
- clearObjects = false
- end},
- {Text = "Convert workspace", Action = function()
- selection = workspace:GetChildren()
- clearObjects = true
- end},
- }
- end,
- },
- }
- showPrompt = function(index, notice)
- local prompt = Prompts[index]
- local rows = {}
- if notice then
- table.insert(rows, {Text = notice, Info = true, Warning = true})
- end
- for _, text in ipairs(prompt.Text or {}) do
- table.insert(rows, {Text = text, Info = true})
- end
- for _, option in ipairs(prompt.Options()) do
- local choice = option
- table.insert(rows, {
- Text = choice.Text,
- Primary = choice.Primary,
- Action = function()
- if choice.Cancel then
- closePrompt()
- return
- end
- local advance, message = choice.Action()
- if advance==false then
- showPrompt(index, message)
- elseif index<#Prompts then
- showPrompt(index+1)
- else
- beginCompilation()
- end
- end,
- })
- end
- renderPage(prompt.Title, ("Model to Script | Step %d of %d"):format(index, #Prompts), rows)
- end
- local function showResult(output)
- renderPage("Conversion complete", "One output script. No size-based splitting.", {
- {Text = ("Created %s (%s) in Workspace."):format(output.Name, output.ClassName), Info = true},
- {Text = "Source written with UpdateSourceAsync().", Info = true},
- {Text = "Open script", Primary = true, Action = function()
- if not output.Parent then
- warn("M2S: the compiled script was removed from the place.")
- return
- end
- SelectionService:Set({output})
- local ok, opened, message = pcall(function()
- return game:GetService("ScriptEditorService"):OpenScriptDocumentAsync(output)
- end)
- if not ok or not opened then
- warn("M2S: could not open the editor: " .. tostring(ok and message or opened))
- end
- end},
- {Text = "Convert another", Action = function()
- resetOptions()
- showPrompt(1)
- end},
- {Text = "Close", Action = closePrompt},
- })
- end
- beginCompilation = function()
- if isCompiling or uiBusy then return end
- if RunService:IsRunning() then
- showPrompt(4, "Stop playtesting before converting; use Studio edit mode.")
- return
- end
- local root = activePrompt
- uiBusy = true
- renderPage("Converting...", "Closing this window does not cancel an active conversion.", {
- {Text = "Building one output script...", Info = true},
- {Text = "Large models may temporarily pause Studio.", Info = true},
- })
- task.spawn(function()
- if disposed or activePrompt~=root then
- uiBusy = false
- return
- end
- local output = Compile()
- uiBusy = false
- if disposed then return end
- if output then
- SelectionService:Set({output})
- end
- if activePrompt~=root then return end
- if output then
- showResult(output)
- else
- renderPage("Conversion failed", "See Studio's Output window for the full error.", {
- {Text = "The converter could not finish. No partial output was kept.", Info = true, Warning = true},
- {Text = "Try again", Primary = true, Action = function() showPrompt(4) end},
- {Text = "Close", Action = closePrompt},
- })
- end
- end)
- end
- local function attachDragging(root)
- local main = root.Main
- local titleBar = main.TitleBar
- local dragging = false
- local dragStart
- local startPosition
- local touchInput
- titleBar.InputBegan:Connect(function(input)
- if input.UserInputType==Enum.UserInputType.MouseButton1 or input.UserInputType==Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPosition = main.Position
- touchInput = input.UserInputType==Enum.UserInputType.Touch and input or nil
- end
- end)
- table.insert(windowConnections, UserInputService.InputChanged:Connect(function(input)
- if not dragging or activePrompt~=root then return end
- if input.UserInputType==Enum.UserInputType.MouseMovement or input==touchInput then
- local delta = input.Position - dragStart
- main.Position = UDim2.new(
- startPosition.X.Scale, startPosition.X.Offset + delta.X,
- startPosition.Y.Scale, startPosition.Y.Offset + delta.Y
- )
- end
- end))
- table.insert(windowConnections, UserInputService.InputEnded:Connect(function(input)
- if input.UserInputType==Enum.UserInputType.MouseButton1 or input==touchInput then
- dragging = false
- end
- end))
- end
- local function openPrompt()
- if disposed then return end
- if activePrompt then return end
- if isCompiling or uiBusy then
- warn("M2S: a conversion is already in progress.")
- return
- end
- resetOptions()
- local newPrompt = promptGui:Clone()
- newPrompt.Name = WINDOW_NAME
- activePrompt = newPrompt
- newPrompt.Main.TitleBar.Exit.Activated:Connect(closePrompt)
- newPrompt.Destroying:Connect(function()
- if activePrompt==newPrompt then
- activePrompt = nil
- disconnectAll(windowConnections)
- windowConnections = {}
- uiBusy = isCompiling
- end
- end)
- attachDragging(newPrompt)
- newPrompt.Parent = CoreGui
- showPrompt(1)
- end
- local function cleanup(initAlreadyDestroying)
- if disposed then return end
- disposed = true
- closePrompt()
- disconnectAll(lifetimeConnections)
- lifetimeConnections = {}
- promptGui:Destroy()
- promptBasis:Destroy()
- optionBasis:Destroy()
- if toolbar then
- pcall(function() toolbar:Destroy() end)
- end
- if not initAlreadyDestroying then
- init:Destroy()
- end
- end
- init.Destroying:Connect(function() cleanup(true) end)
- launcher.Activated:Connect(openPrompt)
- local hidden = false
- if pluginHandle then
- local settingsOK, savedHidden = pcall(function() return pluginHandle:GetSetting("Hidden") end)
- hidden = settingsOK and savedHidden==true
- local toolbarOK, toolbarError = pcall(function()
- toolbar = pluginHandle:CreateToolbar("M2S")
- toolbarButton = toolbar:CreateButton("M2SStandaloneToggle", "Show or hide the M2S launcher", "", "M2S")
- toolbarButton:SetActive(not hidden)
- toolbarButton.Click:Connect(function()
- hidden = not hidden
- launcher.Visible = not hidden
- toolbarButton:SetActive(not hidden)
- pcall(function() pluginHandle:SetSetting("Hidden", hidden) end)
- end)
- end)
- if not toolbarOK then
- hidden = false
- warn("M2S: toolbar unavailable; use the on-screen launcher. " .. tostring(toolbarError))
- end
- table.insert(lifetimeConnections, pluginHandle.Unloading:Connect(function() cleanup(false) end))
- end
- launcher.Visible = not hidden
- -- The Command Bar has no persistent plugin installation; open the wizard now.
- if not pluginHandle then
- openPrompt()
- end
Add Comment
Please, Sign In to add comment