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

Is there a way to spawn in a mesh rig through script?

I've tried to do it with Instance.new but it didn't work

local NPC = Instance.new("CreateMeshRig", game.Workspace)

9 comments

0

CreateMeshRig isn't an object. Thats why.

0

Oh, but is there a way to spawn one in through script or no

0

Why would you want to do this, anyways?

0

I'm making a game that has NPCs spawn with a script and skins in them. I'm spawning a random number of them.

0

Plz help me if u can.

0

But why are you using rigs and not NPCs you made.... Rigs are for animating..

0

yea because I need to insert decals/meshes through script into the npc

0

Well you should have explained that in your question first...

0

Sorry, but is there a way?

1 answer

✓ Accepted answer

I'd recommend you NOT to use animation rigs. I'm not sure why you'd want to use those, but it's probably best if you didn't. Make your own or get and customize a free model one. In addition, you cannot instantiate the rig, as it is not an instance. I'm pretty sure you can create your own NPC with mesh parts in it? Not entirely sure.

Instead of trying to create the rig from scratch using the script, it would be preferable that you have your rig already created, and stored in the the game's ServerStorage. This way you can use your script to clone the NPC out of the storage and into the Workspace with ease.

local NPC = game:GetService('ServerStorage'):WaitForChild('NPC')

game.Players.PlayerAdded:connect(function(Player)
	NPC:Clone().Parent = workspace
end)

1 comment

0

Ohhh, I see what you mean. That is genius!! Thanks so much!!

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