rojo/.cursor/rules/roblox/reference/engine/classes/Pants.yaml
2026-02-02 12:08:47 -06:00

72 lines
2.3 KiB
YAML

# This file is automatically generated. Please don't edit it manually.
# To submit a bug report on the content, see
# https://devforum.roblox.com/c/bug-reports/documentation-issues/72
name: Pants
type: class
memory_category: Instances
summary: |
Displays a Pants texture from the Roblox website to display on a
`Class.Humanoid` rig.
description: |
The `Pants` object displays a pants texture from Roblox on a `Class.Humanoid`
rig. Pants cover the torso and legs, and will be covered by a `Class.Shirt` on
the torso. To be visible, a `Pants` must be a sibling of a `Class.Humanoid`
and have its `Class.Pants.PantsTemplate|PantsTemplate` property set to an
appropriate texture such as `rbxassetid://86896501`. The pants texture may be
colorized using the `Class.Clothing.Color3` property.
Pants are automatically loaded on `Class.Player` characters if their avatar is
wearing one.
code_samples:
- Shirt-Pants
inherits:
- Clothing
descendants: []
tags: []
deprecation_message: ''
properties:
- name: Pants.PantsTemplate
summary: |
Determines the texture of the `Class.Pants`.
description: |
The content ID link pointing to the pants template hosted on Roblox.
This content ID is different than the website URL of the pants. It can be
found by pasting the website URL of the pants into the **PantsTemplate**
property in Studio. Alternatively, `Class.InsertService:LoadAsset()` can
be used to insert the pants into the workspace, for example:
```
local InsertService = game:GetService("InsertService")
local Workspace = game:GetService("Workspace")
local webURL = "https://www.roblox.com/catalog/1804739/Jeans"
local assetId = tonumber(string.match(webURL, "%d+") or 0) -- Extract the number
local success, model = pcall(function()
return InsertService:LoadAsset(assetId)
end)
if success then
model.Parent = Workspace
end
```
For a `Class.Shirt` object's template, see `Class.Shirt.ShirtTemplate`.
code_samples:
- Shirt-Pants
type: ContentId
tags: []
deprecation_message: ''
security:
read: None
write: None
thread_safety: ReadSafe
category: Appearance
serialization:
can_load: true
can_save: true
capabilities:
- Avatar
methods: []
events: []
callbacks: []