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

Change Clothes When TextButton IsClicked?

Asked by 6 years ago
Edited 6 years ago

so player clicks the buttons and changes his clothes But this Local script is not working. Local Script Is Not Mine. But i tried to fix still dont works so i came here to ask for help.

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

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

0
Is this a script or a Localscript? DogeIsDohj 10 — 6y
0
Make sure to add a line that tells the system what "mouse" is stumplee555 4 — 6y
0
what u mean? mouse is.. User#21499 0 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

The problem is not the script, when getting clothing id's, you need to subtract one from the Id. For example, your first Id 478566599 should be 478566598

Ad

Answer this question