Variable not updating with its BoolValue object

Screen Shot 2022-08-02 at 7.45.43 PM

  1. What do you want to achieve? I am trying to check the BoolValue(can_awaken)'s value that is made from another script. The reason I use plr:GetChildren() instead of just straight up using
    plr:WaitForChild("can_awaken) is because it always returns back with “infinite yield”. This was another problem I had before. I talked with other scripters and someone on the DevForum about it and they couldn’t find a solution, so I tried :GetChildren() which was the only thing that has worked.

  2. What is the issue? The issue is that, for some reason, even if the value of the BoolValue changes, the can_awaken.Value (variable) is always false

  3. What solutions have you tried so far? I have tried searching around DevForum for my problem and doing redundant things like can_awaken.Value = can_awaken.Value since I couldn’t figure it out.

Im guessing it is because when you get a value from :GetChildren() the variable won’t update anymore, but it is only a guess. If so, then I don’t know how I will reference the BoolValue.

Any thoughts?

I’m not sure if this will help, but if you wanted to use a WaitForChild() you could put a number in the second parameter for the limit of how long it will wait for it until it stops, so it won’t give an infinite yeild, like plr:WaitForChild("can_awaken",5)
I’m not sure if this will fix your initial problem though, this is just for the WaitForChild problem.

1 Like

I have tried that and sadly it doesn’t work. Thanks for the suggestion though!

1 Like

Ah ok, sorry.

Edit: Have you tried changing can_awaken = child to can_awaken = child.Value? Or if it’s a local script maybe it’s not working because of that?

1 Like

The can_awaken BoolValue is created via server script, also if I change it to child.Value it returns with “attempt to index boolean with ‘Value’” which might mean child is only the value and not the actual BoolValue object? That would be weird if so, especially since when I print the child it is the BoolValue objects name.

1 Like

Ok. So if the script changing the variable isn’t a local script, I don’t know what might be wrong. Sorry I couldn’t help

IS it in a localscript? The server can’t detect changes made locally. It probably isn’t, though, so here’s some solutions

First, you misspelled tostring. lol.

Second, yeah. That’s the problem. You have to somehow get it by using waitforchild or findfirstchild or something. If you upload the full code, perhaps I can help a bit more.

1 Like

Update: Changing it so that the server affects the BoolValue’s value worked. I knew that creating objects in the client could not be seen by the server, but I didn’t know to how far of an extent what the server can’t see of the client. Also, :FindFirstChild and setting it to recursive worked. I never thought of using it since I thought it was basically the same as :WaitForChild, but I guess not. Thanks for the help!

1 Like