Im trying to load clothing ( pants and shirt ) but I always get this error:
Unable to assign property ShirtTemplate. Content expected, got nil
Code:
local DataStoreService = game:GetService("DataStoreService")
local ShirtStore = DataStoreService:GetDataStore("ShirtStore")
local PantsStore = DataStoreService:GetDataStore("PantsStore")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local success, ShirtID = pcall(function()
ShirtStore:GetAsync(player.UserId)
end)
if success then
print("Shirt Loaded!")
player.Character.Shirt.ShirtTemplate = ShirtID
end
local success1, PantsID = pcall(function()
PantsStore:GetAsync(player.UserId)
end)
if success1 then
print("Pants Loaded!")
player.Character.Pants.PantsTemplate = PantsID
end
end)
end)