Want to create a Attribute as a property of a Folder

like this

not like this

image

when i try to use the way the dev way i allways come back indexing to nil

	local uc = Instance.new("Folder")
		uc.Name = "UpgradeCost"
		uc.Parent = bon
		
		local attrUC2 = config:FindFirstChild("UpgradeCost")
		attrUC2:SetAttribute("uc", 440)   -- error on this line

i need to create the attribute with a script for the modules to work properly

Why do you believe that? I would see that as the case if you use Instance | Roblox Creator Documentation but if it returns nil you can just set a default value or what ever value you like.

i cant even find a example to set it as a bool, string, number ect

well i want the value to be a number in a table in a module script but i cant figure out how to set it up properly

You just set it with what ever you like would automatically determine what value type it is

You gotta be more specific here I cant fully understand what you mean/ What your trying to do


i want to create this through a server script it cant be done inside studio it has to be in a remote function server side, i created the folder no problem i just want to create the upgradecost number value in the folders properties

	local uc = Instance.new("Folder")
		uc.Name = "UpgradeCost"
		uc.Parent = bon
-- folder made ezpz

 local uc2 = Instance.new("NumberValue")
uc2.Name = "UpgradeCost"
uc2.Value require(blah blah blah from my modulescript)
uc2.  -- no parent i want it inside folder properties

try doing:

local uc = Instance.new("Folder")
uc.Name = "UpgradeCost"
uc.Parent = bon
		
uc:SetAttribute("uc", 440)

unless if attrUC2 is different from uc

1 Like

image

thx man it worked