no, its color3
///////////////////
hold on im going to edit the code above so copy it again when ive finished editing
did it, try it out
ok
ok, every = sign says expected identifier , got = . and every word except Colors says assigning 2 values to 1 variable makes some values unused
Colors = { Red = "#FF0000", Yellow = "#FFE600", Green = "#45DB00", LightBlue = "#00FFE1", Blue = "#008CFF", Pink = "#FF00FF", Purple = "#BF00FF", White = "#FFFFFF", Black = "#000000" }
change that for this one?
ok, it sets the color on the leaderboard to the choice but its still black when i press
local function changePartColor(part, colorpicked)
print(Colors[colorpicked])
part.Color = Color3.new(Colors[colorpicked])
end
try to debug with this code. click a part after you change what color you selected and tell me what the output is
nil
//////////////////////////////////
try changing this line to this:
part.Color = Color3.new(Colors[tostring(colorpicked)])
nil again
(sorry if this makes u want to quit)
i got nil
/////////////////////////////////////
ok sorry i was away
\\\\\\\\
its ok
//////////////////////////////////
Colors = { ["Red"] = "#FF0000", ["Yellow"] = "#FFE600", ["Green"] = "#45DB00", ["Light Blue"] = "#00FFE1", ["Blue"] = "#008CFF", ["Pink"] = "#FF00FF", ["Purple"] = "#BF00FF", ["White"] = "#FFFFFF", ["Black"] = "#000000" }
change the dictionary to this
part.Color = Color3.new(Colors[colorpicked])
change the part.color
line to this and test it
still the output is nil
////////////
i typed this part wrong use this instead
part.Color = Color3.new(Colors[tostring(colorpicked)])
nope
/////////////////////////////////////////////////////
doesnt work
//////////////////////////
does it print nil like the one before?
\\\\\\\\
sorry i had to take a break, also yess
try this version
game.Players.PlayerAdded:Connect(function(Player)
local partsFolder = workspace:WaitForChild("Parts")
local colorButtons = Player.PlayerGui:WaitForChild("ScreenGui").Frame
Colors = { "Red" = "#FF0000", "Yellow" = "#FFE600", "Green" = "#45DB00", "Light Blue" = "#00FFE1", "Blue" = "#008CFF", "Pink" = "#FF00FF", "Purple" = "#BF00FF", "White" = "#FFFFFF", "Black" = "#000000" }
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local Color = Instance.new("StringValue")
Color.Parent = leaderstats
Color.Name = "Color"
local function changePartColor(part, colorpicked)
print("Changing color of part:", part.Name, "to color:", colorpicked)
part.Color = Color3.new(Colors[tostring(colorpicked)])
print("New color of part:", part.Name, "is:", part.Color)
end
for i, Button in pairs(colorButtons:GetChildren()) do
if Button:IsA("TextButton") then
Button.MouseButton1Click:Connect(function()
Player.leaderstats.Color.Value = Button.Name
end)
end
end
for _, part in ipairs(partsFolder:GetChildren()) do
if part:IsA("BasePart") then
local clickDetector = Instance.new("ClickDetector")
clickDetector.Parent = part
clickDetector.MouseClick:Connect(function()
changePartColor(part, Player.leaderstats.Color.Value)
end)
end
end
end)
edit: i made some quick changes copy it again