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

My last question to day, I need a on touch script to add cloths to a person?

I want this script so players touch the mannequin and it puts the cloths on them this is mt script.

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)

It wont work though.

4 comments

0

You can try to use rbxassetid:// instead of http://www.roblox.com/asset/?id=

0

I have never been able to instantly put on clothes by touching a mannequin. I don't think you should expect that kind of magic either.

0

You could also just put the number instead... it will automatically format it.

0

@SummerEquinox actually I'm pretty sure that behavior only takes effect in studio.

1 answer

Use rbxassetid:// instead of www.roblox.com/asset?id. If this didn't work, what error did you get on the console output?

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