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.
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)