function player_service.playerAdded(plr: Player)
local profile = profilestore:LoadProfileAsync("player_"..plr.UserId)
if profile == nil then
plr:Kick("Data error occured. Rejoin.")
return
end
profile:AddUserId(plr.UserId)
profile:Reconcile()
profile:ListenToRelease(function()
manager.profiles[plr] = nil
plr:Kick("Data error occured. Rejoin.")
end)
if plr:IsDescendantOf(players) then
manager.profiles[plr] = profile
player_service.createStats(plr)
else
profile:Release()
end
local function extractAssetId(assetString: string): number?
return tonumber(assetString:match("%d+"))
end
local humanoid_desc = players:GetHumanoidDescriptionFromUserId(plr.UserId)
humanoid_desc.Shirt = extractAssetId(profile.Data.shirt)
humanoid_desc.Pants = extractAssetId(profile.Data.pants)
plr:LoadCharacterWithHumanoidDescription(humanoid_desc)
end
Doesnt load with the shirt or pants id, either loads with:
http://www.roblox.com/asset/?id=867826313
http://www.roblox.com/asset/?id=855777285
or the clothes that the player has equipped on the website