Say I have some folder with BoolValue
s.
If I do:
folder["Name"].Value = true
then this will give me a warning.
But even if I do
if folder:FindFirstChild("Name") then
folder["Name"].Value = true
end
It’ll still warn me about dynamically accessing the folder. How can I tell it to bugger off?
That said, if I do:
(folder :: any)["Name"].Value
It works fine, but I lose out on autocomplete
just do (folder[“Name”]::InstanceTypeHere).Value
Wait hold on a minute…
Pal wth are you doing?
local ins = folder:FindFirstChild("Name")
if ins then
(ins::BoolValue).Value = true
end
Obviously typecheck freaked out
Becouse its problem in your code itself
You were indexing property of an instance and not its descedant.
1 Like
aw man, so I have to use findfirstchild()
outside of the if statement?
yes
It has similar behavior to __index metamethod
If it doesnt find a property then it will try finding a child
Not sure about some cryptically named roblox security properties will it try to index them or not.
1 Like
ardrous
(ardrous)
July 12, 2025, 5:14pm
7
No, it’s just better practice to use the returned value of FindFirstChild()
.