Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to use a mesh in game, not a roblox asset?

I am currently creating a tycoon game with droppers, here is the code within a specific dropper:

wait(2)
workspace:WaitForChild("PartStorage")


deb = true 
script.Parent.Clicker.ClickDetector.MouseClick:connect(function(wat)
	if deb == true then
		deb = false
			local part = Instance.new("Part",workspace.PartStorage)
			part.BrickColor = script.Parent.Parent.Parent.DropColor.Value
			local cash = Instance.new("IntValue",part)
		cash.Name = "Cash"
		cash.Value = 3
		part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1,0)
		local mesh = Instance.new("SpecialMesh", part)
		mesh.MeshType = "FileMesh"
		mesh.MeshId = "rbxassetid://57718450"
		mesh.TextureId = "rbxassetid://139677274"
		part.TopSurface = "Smooth"
		part.Size = Vector3.new(1,1,1)
		part.Rotation = Vector3.new(-0,-0,0)
		game.Debris:AddItem(part,20) 
			wait(.15)
			deb = true
	end
end)

My question is, how would I make the mesh.MeshId use a model that is within the game, not one that is taken from the roblox website (a roblox asset).

I would imagine it would look something like:

mesh.MeshId = script.Parent.DropModel

(But I know this is wrong) I am pretty new to scripting so if you could explain in detail it would be helpful, thanks!

1 answer

✓ Accepted answer

You cant really do that in a way like use a model as the MeshId, because the MeshId is meant to get an actual mesh from the site. Something you could do is recreate the model inside something like blender then export it as a fbx file allowing you to import it to Roblox then getting the MeshId for that, you could even export that model as an obj file import it into blender maybe then export it as a fbx file then import it as a mesh in Roblox? :3 Export model as obj

1 comment

0

Thanks for the answer, I'm gonna create another question that uses parts instead.

This discussion is preserved as it was. New answers, comments, and votes are closed.