エンジンクラス
Shirt
*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。
コードサンプル
シャツ / パンツを変更する
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)
endAPIリファレンス
プロパティ
ShirtTemplate
Shirt.ShirtTemplate: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