How to take input of a clothing ID and putting it on a npc/humanoid

Hello, I am making a GUI where the user enters the id of a shirt/pants, and the mannequin updates displaying the correct shirt/pants.

I just want to know how I can store the value given by the user from the GUI in a variable so I can update the mannequin to the id the user gave.

1 Like

Insert this into a textbox (this script will change the mannequins shirt):

--//Variables
local TextBox = script.Parent
local Mannequin = workspace.Dummy --//Reference your mannequin

--//Functions
TextBox.FocusLost:Connect(function(enterPressed)
	if enterPressed then
		Mannequin.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=" .. TextBox.Text
	end
end)

Insert this into another textbox (this script will change the mannequins pants):

--//Variables
local TextBox = script.Parent
local Mannequin = workspace.Dummy --//Reference your mannequin

--//Functions
TextBox.FocusLost:Connect(function(enterPressed)
	if enterPressed then
		Mannequin.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=" .. TextBox.Text
	end
end)

when you enter an ID into the Shirttemplate from the studio, Roblox automatically changes the ID to the template of the shirt, but when its entered from the GUI in game, it just changes the name of the Shirttemplate and doesn’t update to the template of the shirt.

For example, if you put this ID “24673629” into the Shirttemplate in Roblox studio, Roblox studio automatically changes that ID to this “24673628” which is the actual template but if you do it in game by a GUI it will just put this ID “24673629” and not update it to the template.

TLDR:
So basically the script you gave only works if you have the ID of the template itself.

I have this shirt giver GUI if you wanted to make it put clothes on a mannequin instead of a character

Shirt Giver.rbxl (39.7 KB)

Thank you, but I am trying to put the clothes on a mannequin, not the character.

try changing the script so instead of player its your dummy name
like "local player = game.Workspace.dummy

Or maybe change the humanoid location

I tried, but it looks like the whole script is based on the player, and also I’m not sure if it would fix the problem that Katrist script has.

Did you try taking the id of the clothing then adding a shirt on the mannequin by going to the properties menu and then clicking on the mannequin and then adding a shirt then put the I’d on the shirt then test it?

Yes, so that’s what I was saying if you do that Roblox Studio will automatically update the ID to the actual template of the clothes but if you put the ID on the GUI it doesn’t update to the template.

I am trying to find a way so that the user doesn’t need to look for the template ID to enter it in the GUI for the mannequin to change, they could just get the ID of the shirt and put it in the GUI.

(referring to a GUI that just changes the mannequin’s shirt/pants template ID to whatever the user put)

It’s working for me. Here’s my place file:
devforum help (10).rbxl (46.6 KB)
(I believe you just need to get rid of the BodyColors instance if it’s not working for you)

It does not work in the game you sent me it just puts the id into the shirt template and the mannequin doesn’t update.

Here is a solution I found that tackles this problem.

Oh, sorry for the misunderstanding. If you solved it, you should mark one of these posts as the post’s solution so people don’t keep trying to solve it.

1 Like