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

Putting on clothes when you click a GUI?

Asked by
dreamy67 135
10 years ago

Im trying to make a script so when you click a GUI it will put shirts and pants on your character

This is what I have right now

shirtid = "http://www.roblox.com/asset/?id=146978987"
pantsid = "http://www.roblox.com/asset/?id=54361253"
button = script.Parent

button.MouseButton1Click:conect(function()
    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)

2 answers

Log in to vote
0
Answered by
Sublimus 992 Moderation Voter
10 years ago

Here, I can fix it up a little bit:

--Put this in a local script inside the textbutton
shirtid = "http://www.roblox.com/asset/?id=146978987"
pantsid = "http://www.roblox.com/asset/?id=54361253"
button = script.Parent

button.MouseButton1Click:conect(function()
    player = game.Players.LocalPlayer
        char = player.Character
        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)

Ad
Log in to vote
0
Answered by 10 years ago

WHy does it have to be a free model huner?

0
? Sublimus 992 — 10y

Answer this question