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

How do you insert Pant into a player or so?

Asked by 8 years ago
pants = script.Parent.Pants:GetChildren()
shirts = script.Parent.shirts:GetChildren()
faces = script.Parent.Faces:GetChildren()
hairs = script.Parent.Hair:GetChildren()
maindummy = game.Workspace.Camera.Dummy_3D
dummy = script.Parent.Dummy
repeat wait() until maindummy and dummy and hairs and faces and shirts and pants

script.Parent["Pant Label"].Next.MouseButton1Click:connect(function()
    curSpawn = pants[math.random(1,#pants)]
    wait() --Let the Character fully load
    for _,v in pairs(maindummy:GetChildren()) do
            if v:IsA("Pants") then
                v:Destroy()
                curSpawn = maindummy
            end
        end
    for _,v in pairs(dummy:GetChildren()) do
        if v:IsA("Pants") then
            v:Destroy()
            curSpawn = dummy
        end
    end
end)

So I have this folder in my explorer that has like a lot of pants and I want it to random choose the one of it and copy and paste it into the player, how would I do that?

1 answer

Log in to vote
0
Answered by
Pyrondon 2089 Game Jam Winner Moderation Voter Community Moderator
8 years ago

Using the Pants object, you can insert pants into the player. Just set the pants template to the asset id of the pants you intend to use.

Ad

Answer this question