코드 샘플
셔츠 / 바지 변경
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