I retried make default clothing script but it wont work again(With unknown reason)
Script:
Players.PlayerAdded:Connect(function(plr)
local DefaultHumanoidDesc = Players:GetHumanoidDescriptionFromUserId(plr.UserId)
if DefaultHumanoidDesc.Pants == 0 then
DefaultHumanoidDesc.Pants = 240589254
end
plr:LoadCharacterWithHumanoidDescription(DefaultHumanoidDesc)
end)
Players.PlayerAdded:Connect(function(plr)
local DefaultHumanoidDesc = Players:GetHumanoidDescriptionFromUserId(plr.UserId)
if DefaultHumanoidDesc.Shirt == 0 then
DefaultHumanoidDesc.Shirt = 750876673
end
plr:LoadCharacterWithHumanoidDescription(DefaultHumanoidDesc)
end)
If you open up Game Settings in the Roblox Studio then click Avatar you can scroll down to Clothing … From there you can override T-Shirt, Shirt and Pants. Making them default Clothing for all.
I messed around with this from your other question and I don’t think you can have no Clothing. From what I seen Roblox will put a default set on the player calling them Clothing.
Maybe try detecting if they have that set on and change them directly from their templates.
PantsTemplate and ShirtTemplate … just swap the rbxassetid://??? with yours.
I tried this, but character dont weared clothes (Studs)
Players.PlayerAdded:Connect(function(plr)
local DefaultHumanoidDesc = Players:GetHumanoidDescriptionFromUserId(plr.UserId)
if DefaultHumanoidDesc.Pants == 0 then
local pants = Instance.new("Pants",plr.Character)
pants.PantsTemplate = "http://www.roblox.com/asset/?id=240589253"
end
plr:LoadCharacterWithHumanoidDescription(DefaultHumanoidDesc)
end)
Players.PlayerAdded:Connect(function(plr)
local DefaultHumanoidDesc = Players:GetHumanoidDescriptionFromUserId(plr.UserId)
if DefaultHumanoidDesc.Shirt == 0 then
local shirt = Instance.new("Shirt",plr.Character)
shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=750876671"
end
plr:LoadCharacterWithHumanoidDescription(DefaultHumanoidDesc)
end)
I repeat, i want if character dont have any clothing game wearing clothing(Studs):
Players.PlayerAdded:Connect(function(plr)
local DefaultHumanoidDesc = Players:GetHumanoidDescriptionFromUserId(plr.UserId)
if DefaultHumanoidDesc.Shirt == 0 then
DefaultHumanoidDesc.Shirt = 750876673
end
if DefaultHumanoidDesc.Pants == 0 then
DefaultHumanoidDesc.Pants = 240589254
end
plr:LoadCharacterWithHumanoidDescription(DefaultHumanoidDesc)
end)
You’re unnecessarily connecting the function twice, which results in only one of them working.
You should be able to straight forward change both by the names Shirt and Pants.
Using ShirtTemplate and PantsTemplate … maybe give it time to load everything then swap.
Try adding plr.CharacterAdded:Wait() before DefaultCharacterDesc. It’s probably not working because you’re trying to load the player’s character before it even finished loading.
Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Wait() -- waits for the character to load
local DefaultHumanoidDesc = Players:GetHumanoidDescriptionFromUserId(plr.UserId)
if DefaultHumanoidDesc.Shirt == 0 then
DefaultHumanoidDesc.Shirt = 750876673
end
if DefaultHumanoidDesc.Pants == 0 then
DefaultHumanoidDesc.Pants = 240589254
end
plr:LoadCharacterWithHumanoidDescription(DefaultHumanoidDesc)
end)
Try this one. I modified @2112Jay’s code to instead of getting the HumanoidDescription from UserId, get the HumanoidDescription from the Humanoid itself!
Players.PlayerAdded:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:FindFirstChildOfClass("Humanoid")
local DefaultHumanoidDesc = hum:GetAppliedDescription()
if DefaultHumanoidDesc.Shirt == 0 then
DefaultHumanoidDesc.Shirt = 750876673
end
if DefaultHumanoidDesc.Pants == 0 then
DefaultHumanoidDesc.Pants = 240589254
end
plr:LoadCharacterWithHumanoidDescription(DefaultHumanoidDesc)
end)
Players.PlayerAdded:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:FindFirstChildOfClass("Humanoid")
local DefaultHumanoidDesc = hum:GetAppliedDescription()
if DefaultHumanoidDesc.Shirt == 0 then
DefaultHumanoidDesc.Shirt = 750876673
end
if DefaultHumanoidDesc.Pants == 0 then
DefaultHumanoidDesc.Pants = 240589254
end
plr:LoadCharacterWithHumanoidDescription(DefaultHumanoidDesc)
end)