Ad
Log in to vote
1

How do I give players shirts, pants and a hat?

Asked by 8 years ago

Generally speaking, how would you give a player these things via scripting?

1 answer

Log in to vote
1
Answered by
Everesty 1006 Moderation Voter
8 years ago

First, you should check if the character has a shirt or pants on, and remove those. You can use the FindFirstChild method for this.

if char:FindFIrstChild("Shirt") then
    char.Shirt:Destroy()
end
if char:FindFIrstChild("Pants") then
    char.Pants:Destroy()
end

After that, you can instance a Shirt or Pants, set their ShirtTemplate or PantsTemplate property to set the template that will be used.

Once you've done that, adding a hat is as simple as cloning one then setting it's parent to the character.

Ad

Answer this question