Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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.

0
You can try to use rbxassetid:// instead of http://www.roblox.com/asset/?id= Icy_Qube 29 — 5y
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. User#25115 0 — 5y
0
You could also just put the number instead... it will automatically format it. SummerEquinox 643 — 5y
0
@SummerEquinox actually I'm pretty sure that behavior only takes effect in studio. Optikk 499 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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

Ad

Answer this question