Why when i try to set attribute, it does not show up in property window, and does not fire the attribute changed event? If i print :GetAttribute(), it still prints it normally. I tried looking up solutions and look for help on discord, but no one has a solution to this. I used to set attribute in the same way, but the script was inefficient in general so i had to change it.
local storage = script.Parent
local parts = storage.Parts
local config = storage.Configuration
local parts = game.ReplicatedStorage.Clones:WaitForChild("Parts")
local rate = config:GetAttribute("Rate")
config.AttributeChanged:Connect(function(att)
if att == "Rate" then
rate = config:GetAttribute("Rate")
end
end)
while true do
local chosenPartsFolder
for i,v in parts:GetChildren() do
local num = v:GetAttribute("Rarity")
local num0 = math.random(1,num)
if num0 == num then
chosenPartsFolder = v
else
chosenPartsFolder = parts.Common
end
end
local chosenPart
for i,v in chosenPartsFolder:GetChildren() do
local num = v:GetAttribute("Rarity")
local num0 = math.random(1,num)
if num0 == num then
chosenPart = v
else
local partName = chosenPartsFolder:GetAttribute("Default")
chosenPart = chosenPartsFolder:FindFirstChild(partName)
end
end
parts:SetAttribute("White",1)
local Value = chosenPart:GetAttribute("Value")
local currentValue = config:GetAttribute("Value")
local parts = config:GetAttribute("Parts")
config:SetAttribute("Value",currentValue + Value)
config:SetAttribute("Parts",parts + 1)
task.wait(rate)
end```
Try to output the value of the rate and the value of the attribute before task.wait(), if they are equal, then everything is working correctly and you made a logical mistake somewhere.
it prints but i really have no idea whats the issue. i’ve made sure a couple times its referenced correctly. the script is in a model, which is stored in variable local storage = script.Parent, then i get the parts children of it which is located in storage, so local parts = storage.Parts, i made sure a couple times, even now that parts are a direct children of storage and script.Parent is storage
Set attribute. Despite running :SetAttribute(), it does nots how up in property window, leading attribute changed event not to fire , and mess up my game mechanism
yes
and bro its so simple what im saying theres something called “properties” which you enable in view and if you click on a part in “explorer” which is also enabled in view then something in properties appears, and if you scroll down there are “attributes”, and attributes are supposed to appear here if you run :setAttribute on a part or any instance
no when parts:SetAttribute is called the attribute changed event doesnt fire because i literally said the attributes dont appear in the properties window do you know what properties window is