R
roblox-ts5w ago
kv_

Invalid attribute

I have a component which takes an attribute "acoustic_zone", the type of which is;
// component
acoustic_zone: Exclude<keyof typeof Workspace.AcousticZones, keyof Folder>;

// declaration
interface Workspace extends Instance {
AcousticZones: Folder & {
Nightclub: Part;
TestZone: Part;
env: Part;
};
}
// component
acoustic_zone: Exclude<keyof typeof Workspace.AcousticZones, keyof Folder>;

// declaration
interface Workspace extends Instance {
AcousticZones: Folder & {
Nightclub: Part;
TestZone: Part;
env: Part;
};
}
This is compiled as a literallist:
Reflect.decorate(WorldAudioEmitter, "$c:components@Component", Component, { {
tag = "WorldAudioEmitter",
attributes = {
audio = t.string,
scope = t.number,
acoustic_zone = t.literalList({ "Nightclub", "TestZone", "env" }),
volume = t.number,
},
instanceGuard = t.instanceIsA("BasePart"),
} })
Reflect.decorate(WorldAudioEmitter, "$c:components@Component", Component, { {
tag = "WorldAudioEmitter",
attributes = {
audio = t.string,
scope = t.number,
acoustic_zone = t.literalList({ "Nightclub", "TestZone", "env" }),
volume = t.number,
},
instanceGuard = t.instanceIsA("BasePart"),
} })
Below I have attached a debugger screenshot, the attribute is a string, has the correct key, and is one of the literals. Attached as well is the error
No description
No description
No description
1 Reply
Lucas
Lucas4w ago
did u add the attributes to the instance

Did you find this page helpful?