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

How to copy a texture to every accessory on a player?

Asked by 2 years ago

Need help on how when a player spawns in, a texture is cloned into each handle of the accessory.

1 answer

Log in to vote
0
Answered by 2 years ago

Make a script inside ServerScriptService and paste this:

Comments are there to help you

local id = "rbxassetid://1234" -- change "1234" to your id

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        repeat wait() until char:FindFirstChildWhichIsA("Accessory") -- waits until accessories have loaded in
        for i, v in pairs(char:GetChildren()) do -- loops through all the parts of the character
            if v:IsA("Accessory") then -- checks if v is an accessory
                if v:FindFirstChild("Handle") then -- checks if there is a handle
                    v:FindFirstChild("Handle").TextureID = id -- sets the textureId to your id
                end
            end
        end
    end)
end)

Remember to change 1234 to your id, otherwise it wont work

0
Amazing! I appreciate it. Deltanullex 7 — 2y
0
No problem! :-) Mathilinium 112 — 2y
Ad

Answer this question