Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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)
0
Hat objects are deprecated. User#19524 175 — 5y

1 answer

Log in to vote
0
Answered by
Mr_Unlucky 1085 Moderation Voter
5 years ago
Edited 5 years ago

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)
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 Sergiomontani10 236 — 5y
Ad

Answer this question