Roblox not recognising value object as child

The output prints all the way up to “3”, I tried arranging the order, names, and changed the names but the code never gets passed the combat_radius value whether I use FindFirstChild or .. I would normally report this as a bug, but only Regulars can report bugs, which I’m not. If you’ve encountered this issue before I would be happy to hear how you dealt with it, because this is clearly not normal behaviour. I don’t even get the ‘Infinite Yield’ error, only the ‘not a valid member’ error when I index it directly. I can also confirm that it doesn’t get deleted.

you shouldn’t get that error using WaitForChild

I get that when I use FindFirstChild or index it directly.

What you could potentially do, is implement another check in-case that said CombatRadius isn’t found? A temporary solution would be is to create another new Instance, but that’s unexpected & unusual behavior (Unless if you’re creating this on the client & checking it on the server)

local combat_radius = Configuration:FindFirstChild("CombatRadius") 

if combat_radius == nil then
    local NewValue = Instance.new("IntValue")
    NewValue.Name = "CombatRadius"
    NewValue.Parent = Configuration
end
1 Like

Thank you for your suggestion, however that method wouldn’t replicate the original value, which is what I need. I’ve also tried using a normal folder instead of a Configuration instance, but nothing different happened.

Hm, if nothing you try works then maybe you could report it as a bug? You could just message @Bug-Support as an alternative for Members reporting bugs for the time being

I mean another thing I could think of is creating the values on the server instead manually via a PlayerAdded event so that they’re both replicated across the Server & Client sides, but it’s up to your choice

1 Like

I know this might seem a bit obvious, but did you check if archivable was enabled? FindFirstChild and WaitForChild cant find it if its disabled.

On top of that, you could also remove the .Value and use it when you refer to the variable later, that seems to work for me sometimes

1 Like

I’ve already tried the latter suggestion, but I haven’t checked archivable. I’m unable access a wi-fi network for a week so I can’t check that right now, although I did try copying one of the working objects and renamed it, but the renamed one still didn’t work.

The NPC and script are both server sided.

The only potential things I could think of then is that

A: You could be destroying the Value Object after calling WaitForChild() which is why it states it’s not a valid member?

B: The Archivable property is set to false as @Tetraic mentioned earlier, hence why when you try to index, it results as an error

C: It’s unexpected Lua Programming behavior, especially if WaitForChild() is returning back an error and not a warning & you could possibly report it to @Bug-Support

This is maybe the only things that would make sense as to why it errors :thinking:

2 Likes

A: Value isn’t destroyed, I checked.

B: Possible. However as I mentioned before, a duplicate of a working value object failed to work.

C: This is what I think it is. Small correction, in my case WaitForChild does not return anything, while FindFirstChild returns an error. The script does not proceed with either usage. (Now that I remembered, I might have had warnings disabled :expressionless:)

Thank you for your time and help. I will look into this more once I have access to wi-fi. :pray:

1 Like

Try printing the value from the command bar(if thts wat its called)

1 Like