That error indicates that the script is attempting to assign a value to a property that it does not have permission to modify, thus the MeshId property of the MeshPart is read only meaning it cannot be changed by scripts. You need to use the InsertService instead as it will allow you to insert models from the catalog into the game. Xx
local InsertService = game:GetService("InsertService")
script.Parent.MouseButton1Click:Connect(function()
local newMeshPart = Instance.new('MeshPart')
newMeshPart.Name = "NewMeshPart"
newMeshPart.Anchored = true
newMeshPart.Parent = game.Workspace
local meshId = "rbxassetid://123456789" -- Replace with the desired MeshId
-- Function to handle mesh insertion
local function handleMesh(mesh)
if mesh then
newMeshPart.MeshId = meshId
newMeshPart.TextureID = "" -- Optional: Set the texture ID if needed
-- Set the properties of the mesh part as desired
newMeshPart.Position = Vector3.new(0, 0, 0)
newMeshPart.Size = Vector3.new(1, 1, 1)
newMeshPart.Color = Color3.new(1, 1, 1)
print("MeshPart created successfully!")
else
print("Failed to load mesh with MeshId:", meshId)
end
end
-- Load the mesh asynchronously using the InsertService
local success, mesh = pcall(function()
return InsertService:LoadAssetMeshAsync(meshId)
end)
if success and mesh then
handleMesh(mesh)
else
print("Failed to load mesh with MeshId:", meshId)
end
end)
And can I set the mesches off sale in marketplace or work it then not
Yes that looks good, as for your question about setting meshes off sale in the marketplace, if you’re using an asset from the catalog, you don’t have control over its availability. The availability of assets on the marketplace is determined by the asset owner. You can use any publicly available asset ID in your game without needing to worry about its availability. However keep in mind that if the asset owner decides to remove or modify the asset, it may affect your game if it relies on that asset. Xx
Ok but I use my own mesches but as it for insert it must be published then it’s during mounts to get all in the game because I have a limit from 10 a month