I have this script that if you have a value, you should get a new hair color on a reset or join, but it doesn't work? Line 24 is the issue although there is no output error, I am almost positive it is, any help, heres the script
local bucnhOfColor = {
[1] = "Black", --Default Shirt
[2] = "Pine Cone", -- Army green
[3] = "rbxassetid://2397305859", --Guess reckless
[4] = "rbxassetid://885261392", --Hawaiian shirt
[5] = "rbxassetid://3144003341", --JackMercando shirt
[6] = "rbxassetid://3152639503", -- Osito Pink Shirt
[7] = "rbxassetid://668772580", -- Red Jacket
[8] = "rbxassetid://554084413", -- Supreme Worldflags
[9] = "rbxassetid://2970602368", -- Tank top
[10] = "rbxassetid://2072675468", -- Tommy hilfiger
[11] = "rbxassetid://2641146107", -- Tour Jacket
[12] = "rbxassetid://604130756", -- Yellow puffer
[13] = "rbxassetid://393696145", -- Yellow puffer
}
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:Connect(function(character)
local d = character:WaitForChild("Hat")
local val = player:WaitForChild("leaderstats").HairColor.Value
if val >= 1 then
wait(1)
if val >= #bucnhOfColor then
d.Handle.BrickColor = BrickColor.new(b ucnhOfColor[#bucnhOfColor])
else
d.Handle.BrickColor = bucnhOfColor[val]
end
end
end)
end)

6 comments
use
BrickColor.new()notBrickColor.new[]Use the brackets when referring to the item in the table
brickcolor.new is a function, therefore it should have a
:()beside it not a:[]Its still not working even with the ()
Are the asset IDs written from the third key of the dictionary named "bunchOfColors" supposed to exist? And did it work when you obtain your first point?
So I had a shirt giver script, and now im trying to make a hair giver, so that is just leftover code until I get this fixed.