Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Character Customization script not working correctly. Any way to fix this?

Basicly when you click the arrow it changes your clothing text to what you wanna wear (Already works) but the problem is that for some reason it is not updating correctly, when you click it itis suppost to update your character to what you have. But for some reason it doesn't want to work. Any solutions or fixes? If so why was it doing that.

local player = game.Players.LocalPlayer.Name
local Character = game.Workspace[player]
function Update()
	for i,v in pairs(Character:GetChildren()) do
		if v:IsA("Hat") or v:IsA("Pants") or v:IsA("Shirt") then
			v:Destroy()
		end
		game.ReplicatedStorage.ClothingLow.HatsLow[script.Parent.ItemName.Text]:Clone(Character)
	end
end

script.Parent.ItemName.Changed:Connect(Update)

1 comment

0

Hat objects are deprecated.

1 answer

Like what incapaz said, hats were deprecated after the hat customization update when they were replaced by accessories. Instead, do this.

local player = game.Players.LocalPlayer.Name
local Character = game.Workspace[player]
function Update()
    for i,v in pairs(Character:GetChildren()) do
        if v:IsA("Accessory") or v:IsA("Pants") or v:IsA("Shirt") then
            v:Destroy()
        end
        game.ReplicatedStorage.ClothingLow.HatsLow[script.Parent.ItemName.Text]:Clone(Character)
    end
end

script.Parent.ItemName.Changed:Connect(Update)

1 comment

0

Still won't work for some reason, I think it might be with something in the character model? I changed it from local Character = game.Workspace[player] to local Character = game.Workspace.CustomCharacter, both wwont work

This discussion is preserved as it was. New answers, comments, and votes are closed.