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

How do I put clothes on a character when they touch a door?

I want to make it so when a Player touches a door, it puts a certain Shirt and Pants on them. Does anyone know how to do this?

1 answer

I'm not 100% sure this would work, but it goes along the lines of this. You can test it out anyways.

To find out the shirt ID of your shirt/pants (In case the ID in the URL doesn't work), do this.

  1. Make sure that you're wearing the shirt/pants.
  2. Open up ROBLOX Studio
  3. Click Tools>Test>Play Solo
  4. Go into Workspace and find your character
  5. Find your shirt/pants and the first property should be the id!
shirtid = "http://www.roblox.com/asset/?id="
pantsid = "http://www.roblox.com/asset/?id="

script.Parent.Touched:connect(function(hit)
	if hit.Parent:findFirstChild("Humanoid")then
		char = hit.Parent
		if char:findFirstChild("Shirt") then
			char.Shirt.ShirtTemplate = shirtid
		else
			a = Instance.new("Shirt", char)
			a.Name = "Shirt"
			a.ShirtTemplate = shirtid
		end
		if char:findFirstChild("Pants") then
			char.Pants.PantsTemplate = pantsid
		else
			b = Instance.new("Pants", char)
			b.Name = "Pants"
			b.PantsTemplate = pantsid
		end
	end
end)

-Thank me by accepting this answer/bumping up my reputation!

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