local holdingval = game.ReplicatedStorage.holdingval.Value
local holdingv = game.ReplicatedStorage.holdingval
function pick()
if holdingval == 10 then
ten.BackgroundColor3 = Color3.new(1, 1, 1)
end
if holdingval == 20 then
twenty.BackgroundColor3 = Color3.new(1, 1, 1)
end
if holdingval == 30 then
thirty.BackgroundColor3 = Color3.new(1, 1, 1)
end
if holdingval == 40 then
fourty.BackgroundColor3 = Color3.new(1, 1, 1)
end
if holdingval == 50 then
print(“tried5”)
fifty.BackgroundColor3 = Color3.new(1, 1, 1)
end
end
holdingv.Changed:Connect(function()
pick()
end)
holdingval is a NumberValue in Replicated Storage, the if statements don’t do anything, even when the statement is true, and the number is 10,20,30,40,50 etc… Does anyone know the solution?
local holdingv = game.ReplicatedStorage.holdingval
function pick()
local holdingval = holdingv.Value
if holdingval == 10 then
ten.BackgroundColor3 = Color3.new(1, 1, 1)
end
-- the rest just the same as above
if holdingval == 20 then
twenty.BackgroundColor3 = Color3.new(1, 1, 1)
end
if holdingval == 30 then
thirty.BackgroundColor3 = Color3.new(1, 1, 1)
end
if holdingval == 40 then
fourty.BackgroundColor3 = Color3.new(1, 1, 1)
end
if holdingval == 50 then
print("Tried 5")
fifty.BackgroundColor3 = Color3.new(1, 1, 1)
end
end
holdingv.Changed:Connect(function()
pick()
end)