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

Any ways of equipping assets unto Player?

I am wondering if there is any possibility of me making a character wear some shirt/pant. I know this might be harder than it looks, but if someone could help me I'd appreciate it a lot.

So far my scripting is limited to Humanoid, and everything beginner.

3 comments

0

So you want all characters to wear same shirt and pants?

0

Yes. Please.

0

Do you want every character to be identical or only wear the same clothing?

2 answers

game.Players.PlayerAdded:Connect(function(plr)

	local char = plr.Character
	local shirt = Instance.new('Shirt')
	local pants = Instance.new('Pants')

	shirtID = -- Put your shirt ID here
	pantsID = -- Put your pants ID here

	shirt.ShirtTemplate = 'rblxasset://'..shirtID
	pants.PantsTemplate = 'rblxasset://'..pantsID

end

If this doesn't work, just add an R15/R6 rig, add the shirt/pants to it, then name the model 'StarterCharacter' then put it in game.StarterPlayer. Hope this helps! <3

There are several ways to accomplish what you want, such as the Answer by Cvllapse. However, a newer method has been released not too long ago using HumanoidDescription. Bellow is the script that should accomplish your task, of course, don't forget to change the shirt/pants to your desired ID.

game:GetService("Players").PlayerAdded:Connect(function(Plr)
	Plr.CharacterAdded:Connect(function(Char)
		local Hum = Char:WaitForChild("Humanoid")
		local HumDescClone = Hum:GetAppliedDescription() -- Gets current character assets

		HumDescClone.Shirt = "2976901625"
		HumDescClone.Pants = "2968835127"

		repeat wait() until Char.Parent == game.Workspace -- If the char is not in Workspace, you'll recieved a DataModel error for the below line!

		Char.Humanoid:ApplyDescription(HumDescClone)
	end)
end)

1 comment

0

You can also use the above to change bodyparts, and add hats, etc

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