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

Clothing script help? NOT ANSWERED

Asked by
smd34 30
9 years ago

I made a script that will load a player's clothing based on their teams. The script works but the Clothing doesnt load. It sometimes says in the output "failed to resolve texture format." or something like that. This is the script.

--Realy simple function to remove an item
function rmItm(char, itm) 
    --waits for the item just in case
    while not char:WaitForChild(itm) do wait() end
    --finds the item
    local item = char:FindFirstChild(itm)
    --removes the item
    item:remove()
end

--New player
game.Players.PlayerAdded:connect(function (plr)

    print("Player Added:- " .. plr.Name)    

    --character load
    plr.CharacterAdded:connect(function (char)

        --wait for character but clothes do not load??
        while char == nil do wait()end  
        print("Player Sporned:- " .. char.Name)

        wait(5) --dont know how to wait for all of the character to load? shirt not present with other waiting methods? 

        --lopp through all of the characters incase they have multiple hatz etc.
        for _,v in pairs(char:GetChildren()) do

            --character item v class check to see what it realy is just in case the name is wrong
            if v:IsA("Shirt") or v:IsA("Hat") or v:IsA("Pants")then
                rmItm(char, v.Name)
                print("Removed:- " .. v.Name)
            end                                 
        end

        --All done
        print("Player cleaned")

        --I dont know if this will work as i dont have the rsources to test this
        if plr.TeamColor == game.Teams["Atlas"].TeamColor then 
            shirt3 = script.Clothing2:clone()
            shirt4 = script.Pants2:clone()
            shirt3.Parent = char       --Clones and equips the new uniform
            shirt4.Parent = char
        end

    end)    

end)
0
You don't have to wait for the character after using the CharacterAdded event, it does it for you. parkderp1 105 — 9y
0
Also to remove a character's appearance do plr:ClearCharacterAppearance() in your PlayerAdded function, it's a lot easier than doing all of that. parkderp1 105 — 9y
0
but it wouldnt affect the script. How would I get the clothing to load? smd34 30 — 9y
0
It would help you find where the problem. Also check if you can wear the clothing. parkderp1 105 — 9y
View all comments (4 more)
0
Ik you can wear the clothing but it says it failed to resolve texture or something like that. smd34 30 — 9y
0
It must be a Roblox error then. parkderp1 105 — 9y
0
how would I fix that? Its so annoying smd34 30 — 9y
0
You might be able to find a way around it, sorry I can't I'm on a mobile parkderp1 105 — 9y

1 answer

Log in to vote
0
Answered by
Exudo 13
9 years ago

It it most likely outputting "failed to resolve texture format." because it could not find a valid texture, try subtracting 1 from the id of the clothing then try again.

Ad

Answer this question