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

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

So I have been trying to find something like this and I found some that's 5 years old but what I need is to touch a block and get a hat put on my head but I some how cant find out how to and this is what I found and it works! But I thought I found it but it was wrong so can you help me with it? |Script|

shirtid = "http://www.roblox.com/asset/?id=751061408"
pantsid = "http://www.roblox.com/asset/?id=1134006219"
accessoryid = "https://web.roblox.com/catalog/416833190/Tokyokhaos-Lion"

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
         if char:findFirstChild("Accesory") then
             char.Pants.PantsTemplate = pantsid
         else
             b = Instance.new("Accessory", char)
             b.Name = "Accessory"
             b.HatTemplate = accessorysid
         end
     end
 end)

|Info| The clothing part works its just the hat part the dose not! |Warning!| Anybody can use the fixed script!

4 comments

0

Accessories don't have a property called HatTemplate

0

Then how do I fix it?

0

So like speacial mesh?

0

I guess you can do that

2 answers

Accessories have Handles, like tools. You can add a special mesh inside of the Handle (The Handle HAS to be a part named Handle). and then you can change the special mesh

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