Mannequin Try On feature problem?
I'm encountering some problems with a TryOn function that I'm using in my mannequin system. The main issue is that after the remote used for trying on clothing gets called once it sort off breaks and whenever I try to try on other clothing It equips the player with both the Shirt and the Pants of the mannequin instead of only one of them-- in my debug script it prints both Shirt and Pants instead of only one of them. Here's the main function:
01 | local function TryOn(p, player, ClothingId, Action) |
02 | if Action = = "Wear" then |
03 | print ( "ACTION: wear clothing." ) |
05 | local ClothingType = MarketplaceService:GetProductInfo(ClothingId).AssetTypeId |
09 | if ClothingType = = 11 or Enum.AssetType.Shirt then |
11 | elseif ClothingType = = 12 or Enum.AssetType.Pants then |
14 | elseif Action = = "Reset" then |
15 | print ( "ACTION: reset." ) |
16 | player.Character.Shirt.ShirtTemplate = player:FindFirstChild( "originalShirt" ).Value |
17 | player.Character.Pants.PantsTemplate = player:FindFirstChild( "originalPants" ).Value |
21 | TryOnEvent.OnServerEvent:Connect(TryOn) |