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?
COMMUNITY QUESTION
How do I put clothes on a character when they touch a door?
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.
- Make sure that you're wearing the shirt/pants.
- Open up ROBLOX Studio
- Click Tools>Test>Play Solo
- Go into Workspace and find your character
- 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.
