學習
引擎類別
Shirt

*此內容是使用 AI(Beta 測試版)翻譯,可能含有錯誤。若要以英文檢視此頁面,請按一下這裡


概要
屬性
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

API 參考
屬性
ShirtTemplate
平行讀取
功能: AvatarAppearance
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

©2026 Roblox Corporation、Roblox、Roblox 標誌及 Powering Imagination 是我們在美國及其他國家地區的部分註冊與未註冊商標。