学ぶ
エンジンクラス
Pants

*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。


概要
プロパティ
PantsTemplate:ContentId
継承されたメンバー
コードサンプル
シャツ / パンツを変更する
local Players = game:GetService("Players")
local function replaceClothes(player)
local character = player.Character
if character then
-- シャツ / パンツを探す
local shirt = character:FindFirstChildOfClass("Shirt")
local pants = character:FindFirstChildOfClass("Pants")
-- 存在しない場合はシャツ / パンツを作成する
if not shirt then
shirt = Instance.new("Shirt")
shirt.Parent = character
end
if not pants then
pants = Instance.new("Pants")
pants.Parent = character
end
-- シャツ / パンツのコンテンツIDをリセットする
shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=83326831"
pants.PantsTemplate = "http://www.roblox.com/asset/?id=10045638"
end
end
for _index, player in ipairs(Players:GetPlayers()) do
replaceClothes(player)
end

APIリファレンス
プロパティ
PantsTemplate
並列読み取り
機能: AvatarAppearance
Pants.PantsTemplate:ContentId
コードサンプル
シャツ / パンツを変更する
local Players = game:GetService("Players")
local function replaceClothes(player)
local character = player.Character
if character then
-- シャツ / パンツを探す
local shirt = character:FindFirstChildOfClass("Shirt")
local pants = character:FindFirstChildOfClass("Pants")
-- 存在しない場合はシャツ / パンツを作成する
if not shirt then
shirt = Instance.new("Shirt")
shirt.Parent = character
end
if not pants then
pants = Instance.new("Pants")
pants.Parent = character
end
-- シャツ / パンツのコンテンツIDをリセットする
shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=83326831"
pants.PantsTemplate = "http://www.roblox.com/asset/?id=10045638"
end
end
for _index, player in ipairs(Players:GetPlayers()) do
replaceClothes(player)
end

©2026 Roblox Corporation。Roblox(ロブロックス)、RobloxロゴおよびPowering Imaginationは、米国並びにその他の国における登録商標および非登録商標です。