i dont know what point you are trying to make here
Add that and your black list to the other script.
my script does everything that the OP wanted?? i dont need your code snippet.
my script checks to see if the player has no shirt/pants or if they ahve the colored fallback ones. (which will happen with the pants no matter what)
My bad, it saw a list, didn’t see the rest. Works well
-
Connecting Multiple Functions: You don’t need to connect two separate functions to the
Players.PlayerAdded
event. You can combine them into one function. -
Player Character Loading: The script attempts to load the character using
plr:LoadCharacterWithHumanoidDescription(DefaultHumanoidDesc)
, but this method is not recommended for character loading. It can lead to unexpected behavior.
Here’s a revised script that addresses these issues:
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(plr)
-- Create a function to give default clothing
local function giveDefaultClothing()
local DefaultHumanoidDesc = Instance.new("HumanoidDescription")
-- Check if the player has pants
if plr.UserId > 0 and DefaultHumanoidDesc.Pants == 0 then
DefaultHumanoidDesc.Pants = 240589254
end
-- Check if the player has a shirt
if plr.UserId > 0 and DefaultHumanoidDesc.Shirt == 0 then
DefaultHumanoidDesc.Shirt = 750876673
end
-- Load the character with the default clothing
plr.CharacterAppearance = DefaultHumanoidDesc
end
-- Use a delay to ensure the character has loaded
wait(1)
giveDefaultClothing()
end)
In this script:
- We combine the logic for giving default clothing into a single function
giveDefaultClothing
. - We use
Instance.new("HumanoidDescription")
to create a newHumanoidDescription
object to store the default clothing. - We use
wait(1)
to ensure that the player’s character has fully loaded before applying the default clothing. - We set the
plr.CharacterAppearance
property to apply the default clothing.
This revised script should work more reliably for giving players default clothing based on their UserId
.
Not working. In output printing " Unable to assign property CharacterAppearance. string expected, got Instance".
Man, its worked.
Have a good day!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.