So basically I’ve had this error and tried to fix it for 7 months, and it never worked, idk what happened but the message says "BackgroundColor3 is not a valid member of IntValue “Players.YT_PlasaYara.PlayerGui.ScreenGui.Frame.indexMenu.ScrollingFrame.Revolver Gun.difficulty” and I’m gonna need a little help
--- Variables ---
local indexMenu = script.Parent
local collected = indexMenu:WaitForChild("collected")
local scrollingFrame = indexMenu:WaitForChild("ScrollingFrame")
local UIGridLayout = scrollingFrame:WaitForChild("UIGridLayout")
local info = indexMenu:WaitForChild("info")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local gunsFile = ReplicatedStorage:WaitForChild("guns")
local difficultyColours = {
Color3.fromHex("#26ff00"), -- Easy
Color3.fromHex("#ffe308"), -- Medium
Color3.fromHex("#b50003"), -- Hard
Color3.fromHex("#2600ff"), -- Insane
Color3.fromHex("#066800"), -- Extreme
Color3.fromHex("#6702ff") -- Gunerous
}
local difficulties = {
"Easy",
"Medium",
"Hard",
"Insane",
"Extreme",
"Gunerous"
}
local gunsCollected = player:WaitForChild("gunsCollected")
local totalCount = 0
for i, v in pairs(gunsFile:GetChildren()) do
totalCount = totalCount + 1
end
local collectedCount = 0
for i, v in pairs(gunsFile:GetChildren()) do
collectedCount = collectedCount + 1
end
collected.Text = collectedCount.."/"..totalCount.." FOUND"
for i, item in pairs(gunsFile:GetChildren()) do
local itemName = item.Name
local difficulty = item.difficulty.Value
local hint = item.hint.Value
local name = item.name.Value
local image = item.image.Texture
local itemButton = script.templateButton:Clone()
itemButton.Parent = scrollingFrame
itemButton.Name = itemName
itemButton.Image = image
itemButton.difficulty.BackgroundColor3 = difficultyColours[difficulty]
if gunsCollected:FindFirstChild(itemName) then
itemButton.collected.BackgroundTransparency = 1
else
itemButton.collected.BackgroundTransparency = 0.65
end
itemButton.LayoutOrder = difficulty
UIGridLayout.SortOrder = Enum.SortOrder.LayoutOrder
UIGridLayout:ApplyLayout()
end
--- Variables ---
local indexMenu = script.Parent
local collected = indexMenu:WaitForChild("collected")
local scrollingFrame = indexMenu:WaitForChild("ScrollingFrame")
local UIGridLayout = scrollingFrame:WaitForChild("UIGridLayout")
local info = indexMenu:WaitForChild("info")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local gunsFile = ReplicatedStorage:WaitForChild("guns")
local difficultyColours = {
Color3.fromHex("#26ff00"), -- Easy
Color3.fromHex("#ffe308"), -- Medium
Color3.fromHex("#b50003"), -- Hard
Color3.fromHex("#2600ff"), -- Insane
Color3.fromHex("#066800"), -- Extreme
Color3.fromHex("#6702ff") -- Gunerous
}
local difficulties = {
"Easy",
"Medium",
"Hard",
"Insane",
"Extreme",
"Gunerous"
}
local gunsCollected = player:WaitForChild("gunsCollected")
local totalCount = 0
for i, v in pairs(gunsFile:GetChildren()) do
totalCount = totalCount + 1
end
local collectedCount = 0
for i, v in pairs(gunsFile:GetChildren()) do
collectedCount = collectedCount + 1
end
collected.Text = collectedCount.."/"..totalCount.." FOUND"
for i, item in pairs(gunsFile:GetChildren()) do
local itemName = item.Name
local difficulty = item.difficulty.Value
local hint = item.hint.Value
local name = item.name.Value
local image = item.image.Texture
local itemButton = script.templateButton:Clone()
itemButton.Parent = scrollingFrame
itemButton.Name = itemName
itemButton.Image = image
itemButton["difficulty"].BackgroundColor3 = difficultyColours[difficulty]
if gunsCollected:FindFirstChild(itemName) then
itemButton.collected.BackgroundTransparency = 1
else
itemButton.collected.BackgroundTransparency = 0.65
end
itemButton.LayoutOrder = difficulty
UIGridLayout.SortOrder = Enum.SortOrder.LayoutOrder
UIGridLayout:ApplyLayout()
end