Custom Attribute not working

I added a Custom Attribute to an IntValue called " MaxQuantity"
but Roblox is throwing an error when running the game.

MaxQuantity is not a valid member of IntValue “Players.FancyAmbitions.PlayerGui.Gui.Button.Quantity”

It sounds like you’re using dot-notation to access it something.MaxQuantity. Make sure you’re using the specified attribute function:

-- Get attribute:
local maxQuantity = quantity:GetAttribute("MaxQuantity")

-- Set attribute:
quantity:SetAttribute("MaxQuantity", 150)
4 Likes