Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- objects = {
- ["Part"] = {
- BrickColor = BrickColor.new("Medium stone grey"),
- Material = Enum.Material.Plastic,
- Reflectance = 0,
- Transparency = 0,
- Name = "Part",
- CFrame = CFrame.new(Vector3.new(0, 0, 0)),
- RotVelocity = Vector3.new(0, 0, 0),
- Velocity = Vector3.new(0, 0, 0),
- Anchored = false,
- Archivable = true,
- CanCollide = true,
- Locked = false,
- Elasticity = 0.5,
- FormFactor = Enum.FormFactor.Brick,
- Friction = 0.30000001192093,
- Shape = "Block",
- Size = Vector3.new(4, 1.2, 2),
- BackParamA = -0.5,
- BackParamB = 0.5,
- BackSurfaceInput = Enum.InputType.NoInput,
- BottomParamA = -0.5,
- BottomParamB = 0.5,
- BottomSurfaceInput = Enum.InputType.NoInput,
- FrontParamA = -0.5,
- FrontParamB = 0.5,
- FrontSurfaceInput = Enum.InputType.NoInput,
- LeftParamA = -0.5,
- LeftParamB = 0.5,
- LeftSurfaceInput = Enum.InputType.NoInput,
- RightParamA = -0.5,
- RightParamB = 0.5,
- RightSurfaceInput = Enum.InputType.NoInput,
- TopParamA = -0.5,
- TopParamB = 0.5,
- TopSurfaceInput = Enum.InputType.NoInput,
- BackSurface = Enum.SurfaceType.Smooth,
- BottomSurface = Enum.SurfaceType.Inlet,
- FrontSurface = Enum.SurfaceType.Smooth,
- LeftSurface = Enum.SurfaceType.Smooth,
- RightSurface = Enum.SurfaceType.Smooth,
- TopSurface = Enum.SurfaceType.Studs,
- },
- ["Seat"] = {
- BrickColor = BrickColor.new("Medium stone grey"),
- Material = Enum.Material.Plastic,
- Reflectance = 0,
- Transparency = 0,
- Name = "Seat",
- CFrame = CFrame.new(Vector3.new(0, 0, 0)),
- RotVelocity = Vector3.new(0, 0, 0),
- Velocity = Vector3.new(0, 0, 0),
- Anchored = false,
- Archivable = true,
- CanCollide = true,
- Locked = false,
- Elasticity = 0.5,
- FormFactor = Enum.FormFactor.Brick,
- Friction = 0.30000001192093,
- Shape = "Block",
- Size = Vector3.new(4, 1.2, 2),
- BackParamA = -0.5,
- BackParamB = 0.5,
- BackSurfaceInput = Enum.InputType.NoInput,
- BottomParamA = -0.5,
- BottomParamB = 0.5,
- BottomSurfaceInput = Enum.InputType.NoInput,
- FrontParamA = -0.5,
- FrontParamB = 0.5,
- FrontSurfaceInput = Enum.InputType.NoInput,
- LeftParamA = -0.5,
- LeftParamB = 0.5,
- LeftSurfaceInput = Enum.InputType.NoInput,
- RightParamA = -0.5,
- RightParamB = 0.5,
- RightSurfaceInput = Enum.InputType.NoInput,
- TopParamA = -0.5,
- TopParamB = 0.5,
- TopSurfaceInput = Enum.InputType.NoInput,
- BackSurface = Enum.SurfaceType.Smooth,
- BottomSurface = Enum.SurfaceType.Inlet,
- FrontSurface = Enum.SurfaceType.Smooth,
- LeftSurface = Enum.SurfaceType.Smooth,
- RightSurface = Enum.SurfaceType.Smooth,
- TopSurface = Enum.SurfaceType.Studs,
- Disabled = false,
- },
- ["VehicleSeat"] = {
- BrickColor = BrickColor.new("Medium stone grey"),
- Material = Enum.Material.Plastic,
- Reflectance = 0,
- Transparency = 0,
- Name = "VehicleSeat",
- CFrame = CFrame.new(Vector3.new(0, 0, 0)),
- RotVelocity = Vector3.new(0, 0, 0),
- Velocity = Vector3.new(0, 0, 0),
- Anchored = false,
- Archivable = true,
- CanCollide = true,
- Locked = false,
- Elasticity = 0.5,
- Friction = 0.30000001192093,
- Size = Vector3.new(4, 1.2, 2),
- BackParamA = -0.5,
- BackParamB = 0.5,
- BackSurfaceInput = Enum.InputType.NoInput,
- BottomParamA = -0.5,
- BottomParamB = 0.5,
- BottomSurfaceInput = Enum.InputType.NoInput,
- FrontParamA = -0.5,
- FrontParamB = 0.5,
- FrontSurfaceInput = Enum.InputType.NoInput,
- LeftParamA = -0.5,
- LeftParamB = 0.5,
- LeftSurfaceInput = Enum.InputType.NoInput,
- RightParamA = -0.5,
- RightParamB = 0.5,
- RightSurfaceInput = Enum.InputType.NoInput,
- TopParamA = -0.5,
- TopParamB = 0.5,
- TopSurfaceInput = Enum.InputType.NoInput,
- BackSurface = Enum.SurfaceType.Smooth,
- BottomSurface = Enum.SurfaceType.Inlet,
- FrontSurface = Enum.SurfaceType.Smooth,
- LeftSurface = Enum.SurfaceType.Smooth,
- RightSurface = Enum.SurfaceType.Smooth,
- TopSurface = Enum.SurfaceType.Studs,
- Disabled = false,
- HeadsUpDisplay = true,
- MaxSpeed = 25,
- Steer = 0,
- Throttle = 0,
- Torque = 10,
- TurnSpeed = 1,
- },
- ["WedgePart"] = {
- BrickColor = BrickColor.new("Medium stone grey"),
- Material = Enum.Material.Plastic,
- Reflectance = 0,
- Transparency = 0,
- Name = "Part",
- CFrame = CFrame.new(Vector3.new(0, 0, 0)),
- RotVelocity = Vector3.new(0, 0, 0),
- Velocity = Vector3.new(0, 0, 0),
- Anchored = false,
- Archivable = true,
- CanCollide = true,
- Locked = false,
- Elasticity = 0.5,
- FormFactor = Enum.FormFactor.Brick,
- Friction = 0.30000001192093,
- Size = Vector3.new(4, 1.2, 2),
- BackParamA = -0.5,
- BackParamB = 0.5,
- BackSurfaceInput = Enum.InputType.NoInput,
- BottomParamA = -0.5,
- BottomParamB = 0.5,
- BottomSurfaceInput = Enum.InputType.NoInput,
- FrontParamA = -0.5,
- FrontParamB = 0.5,
- FrontSurfaceInput = Enum.InputType.NoInput,
- LeftParamA = -0.5,
- LeftParamB = 0.5,
- LeftSurfaceInput = Enum.InputType.NoInput,
- RightParamA = -0.5,
- RightParamB = 0.5,
- RightSurfaceInput = Enum.InputType.NoInput,
- TopParamA = -0.5,
- TopParamB = 0.5,
- TopSurfaceInput = Enum.InputType.NoInput,
- BackSurface = Enum.SurfaceType.Smooth,
- BottomSurface = Enum.SurfaceType.Inlet,
- FrontSurface = Enum.SurfaceType.Smooth,
- LeftSurface = Enum.SurfaceType.Smooth,
- RightSurface = Enum.SurfaceType.Smooth,
- TopSurface = Enum.SurfaceType.Studs,
- },
- ["FileMesh"] = {
- MeshId = "",
- TextureId = "",
- Offset = Vector3.new(0, 0, 0),
- Scale = Vector3.new(1, 1, 1),
- Archivable = true,
- Name = "Mesh",
- VertexColor = Vector3.new(1, 1, 1),
- },
- ["SpecialMesh"] = {
- MeshType = Enum.MeshType.Head,
- MeshId = "",
- TextureId = "",
- Offset = Vector3.new(0, 0, 0),
- Scale = Vector3.new(1, 1, 1),
- Archivable = true,
- Name = "Mesh",
- VertexColor = Vector3.new(1, 1, 1),
- },
- ["BlockMesh"] = {
- Offset = Vector3.new(0,0,0),
- Scale = Vector3.new(1, 1, 1),
- Archivable = true,
- Name = "Mesh",
- VertexColor = Vector3.new(1, 1, 1),
- },
- ["CylinderMesh"] = {
- Name = "Mesh",
- Offset = Vector3.new(0, 0, 0),
- Scale = Vector3.new(1, 1, 1),
- VertexColor = Vector3.new(1, 1, 1),
- },
- ["Decal"] = {
- Name = "Decal",
- Shiny = 20,
- Specular = 0,
- Texture = "",
- Transparency = 0,
- Face = Enum.NormalId.Front,
- Archivable = true,
- },
- ["Fire"] = {
- Color = Color3.new(1, 127/255, 0),
- Enabled = true,
- Name = "Fire",
- Heat = 9,
- SecondaryColor = Color3.new(1,0,0),
- Size=5,
- Archivable = true,
- },
- ["Smoke"] = {
- Color = Color3.new(1,1,1),
- Enabled = true,
- Name = "Smoke",
- Opacity = 0.5,
- RiseVelocity = 1,
- Size = 1,
- },
- ["Sparkles"] = {
- Enabled = true,
- Name = "Sparkles",
- SparkleColor = Color3.new(112/255, 231/255, 1/255),
- Archivable = true,
- },
- ["Model"] = {
- Name = "Model",
- PrimaryPart = nil,
- Archivable = true,
- },
- ["ClickDetector"] = {
- Name = "ClickDetector",
- MaxActivationDistance = 32,
- Archivable = true,
- },
- ["BoolValue"] = {
- Name = "BoolValue",
- Archivable = true,
- },
- ["BrickColorValue"] = {
- Name = "BoolValue",
- Archivable = true,
- },
- ["Color3Value"] = {
- Name = "BoolValue",
- Archivable = true,
- },
- ["DoubleConstrainedValue"] = {
- Name = "BoolValue",
- Archivable = true,
- },
- ["IntConstrainedValue"] = {
- Name = "BoolValue",
- Archivable = true,
- },
- ["IntValue"] = {
- Name = "BoolValue",
- Archivable = true,
- },
- ["NumberValue"] = {
- Name = "BoolValue",
- Archivable = true,
- },
- ["ObjectValue"] = {
- Name = "BoolValue",
- Archivable = true,
- },
- ["RayValue"] = {
- Name = "BoolValue",
- Archivable = true,
- },
- ["StringValue"] = {
- Name = "BoolValue",
- Archivable = true,
- },
- ["Vector3Value"] = {
- Name = "BoolValue",
- Archivable = true,
- },
- ["CFrameValue"] = {
- Name = "BoolValue",
- Archivable = true,
- },
- ["BodyGyro"] = {
- Name = "BodyGyro",
- Archivable = true,
- D = 500,
- P = 3000,
- maxTorque = Vector3.new(0,0,0),
- },
- ["BodyPosition"] = {
- Name = "BodyPosition",
- Archivable = true,
- D = 1250,
- P = 10000,
- maxForce = Vector3.new(4000,4000,4000),
- position = Vector3.new(0, 50, 0),
- },
- ["Texture"] = {
- Shiny = 20,
- Specular = 0,
- StudsPerTileU = 2,
- StudsPerTileV = 2,
- Texture = "",
- Transparency = 0,
- Face = Enum.NormalId.Front,
- Name = "Texture",
- Archivable = true;
- },
- ["Weld"] = {
- Name = "Weld",
- Part0 = true,
- Part1 = true,
- Archivable = true,
- },
- ["Motor6D"] = {
- Name = "Motor6D",
- Part0 = true,
- Part1 = true,
- Archivable = true
- },
- ["Humanoid"] = {
- Name = "Humanoid"
- },
- ["ManualWeld"] = {
- Name = "Weld",
- Part0 = true,
- Part1 = true,
- Archivable = true,
- },
- }
- function recurse(object, parent)
- fulln = fulln + 1
- if objects[object.ClassName] then
- line = line + 1
- if insert_waits then
- wt = wt + 1
- if wt == 20 then
- content = content.."wait()"..nlc..nlc
- wt = 0
- end
- end
- parsed[object.ClassName] = (parsed[object.ClassName] and parsed[object.ClassName] + 1 or 1)
- content = content.."-- "..line.." - "..object.Name.."\n"
- local var = "obj"..line
- content = content..var.." = Instance.new(\""..object.ClassName.."\")"..nlc
- for i, v in pairs(objects[object.ClassName]) do
- if object[i] ~= v then
- cusv = object[i]
- if type(cusv) == "boolean" then
- cusv = tostring(cusv)
- elseif type(cusv) == "userdata" then
- if i == "BrickColor" then
- cusv = "BrickColor.new(\""..tostring(cusv).."\")"
- elseif i=="Size" or i=="RotVelocity" or i=="Velocity" or i=="Scale" or i=="Offset" or i=="VertexColor" or i=="maxForce" or i=="position" or i=="maxTorque" then
- cusv = "Vector3.new("..tostring(cusv)..")"
- elseif i=="CFrame" then
- local cx, cy, cz = object.CFrame:toEulerAnglesXYZ()
- cusv = "CFrame.new(Vector3.new("..tostring(object.Position)..")) * CFrame.Angles("..cx..", "..cy..", "..cz..")"
- elseif i=="Color" or i=="SecondaryColor" or i=="SparkleColor" then
- cusv = "Color3.new("..tostring(cusv)..")"
- end
- elseif type(cusv) == "string" then
- cusv = "\""..cusv:gsub("\"", "\\\"").."\""
- end
- content = content..var.."."..i.." = "..tostring(cusv)..nlc
- end
- end
- content = content..var..".Parent = "..parent..nlc..nlc
- for i, v in pairs(object:children()) do
- recurse(v, var)
- end
- else
- skipped[object.ClassName] = (skipped[object.ClassName] and skipped[object.ClassName] + 1 or 1)
- skippedn = skippedn+1
- end
- end
- function M2S(model)
- content = ""
- line = 0
- fulln = 0
- parsed = {}
- skipped = {}
- skippedn = 0
- wt = 0
- nlc = "\n"
- wait()
- recurse(model, "Workspace")
- ski = ""
- for i, v in pairs(skipped) do
- ski=ski..i..": "..v.."\n "
- end
- par = ""
- for i, v in pairs(parsed) do
- par=par..i..": "..v.."\n "
- end
- content = "--[[\
- -- M2S by Coolbob44 --\
- Current Version: ".."1".."\
- \
- Model: "..model.Name.."\
- You can use this script to generate your model!\
- \
- Objects Parsed: "..line.."\
- "..par.."\
- Objects Skipped: "..skippedn.."\
- "..ski.."\
- Total: "..fulln.."\
- \
- --]]\
- \n\n"..content
- content = content..nlc.."obj1:MakeJoints()\n"
- print(content)
- local s = Instance.new("Script")
- s.Name = "Model to Script"
- s.Source = content
- s.Parent = Workspace
- end
- M2S(Workspace.Model);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement