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

Applying Character Mesh from Catelog upon CharacterLoad?

I've looked through SH, Wiki, free models, etc and still no luck.

I want to give my players the https://www.roblox.com/catalog/343617819/Rogue-Space-Assassin outfit when they spawn. I know how to change clothes, faces, etc but not CharacterMesh's.

Maybe i can put the id you see in the url in an asset url, I've tried, is there a specific url i should use for packages?

Summary: OnCharacterLoad, change character mesh to Rogue-Space-Assassin or other ROBLOX package.

Thanks in advance.

1 comment

0

I've found this url, "https://www.roblox.com/Game/GetAssetIdsForPackageId?packageId = 343617819" which could help. How would i match the given id's to the needed part?

1 answer

You would need to make use of CharacterMesh objects for each individual body part (left arm, left leg, torso, etc.) and parent them to the player's Character.

Here's how you can do it through a normal server-script:

-- When a player enters the server
game.Players.PlayerAdded:connect(function(player)
	-- Removes player's ability to load his/her appearance
	player.CanLoadCharacterAppearance = false
	-- When the player's character loads
	player.CharacterAdded:connect(function(character)
		wait(0.5) -- Half a second delay to give time to load the Character
		
		-- Creates a new CharacterMesh, adds it to the character
		local leftArm = Instance.new("CharacterMesh", character)
		leftArm.BodyPart = "LeftArm" -- Attaches it to the left arm
		leftArm.MeshId = 343575282 -- Sets its mesh ID
		leftArm.OverlayTextureId = 343563402 -- Sets its texture ID

		local rightArm = Instance.new("CharacterMesh", character)
		rightArm.BodyPart = "RightArm"
		rightArm.MeshId = 343575392
		rightArm.OverlayTextureId = 343563402

		local leftLeg = Instance.new("CharacterMesh", character)
		leftLeg.BodyPart = "LeftLeg"
		leftLeg .MeshId = 343575129
		leftLeg .OverlayTextureId = 343563402
		
		local rightLeg = Instance.new("CharacterMesh", character)
		rightLeg.BodyPart = "RightLeg"
		rightLeg .MeshId = 343574993
		rightLeg .OverlayTextureId = 343563402
		
		local torso = Instance.new("CharacterMesh", character)
		torso.BodyPart = "Torso"
		torso.MeshId = 343572790
		torso.OverlayTextureId = 343563402
	end)
end)

I've gone through the trouble of finding the MeshIds and OverlayTextureIds of each body part for you, but if you want to do this for another package, you would have to find them yourself (by searching for the package in free models and looking through the model and its CharacterMesh objects). I'm assuming you know how to add/remove players' hats, so I'll let you do that part.

Hope this helps! if it does, don't forget to click "Accept Answer" and +1 my Rep!

2 comments

1

Excellent answer, thank you! I'll up-vote as soon as I am able to. 5 Rep needed. Thanks again. Did not expect such a good answer.

0

No problem.

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