Why can't I activate Bool Values by Local Scripts?

Once again, I have a question about local scripts, because whenever I try to activate or deactivate a value of a bool value, it will give me an error?

1 Like

You can change bool Values on the client though GUI`s and else. You cannot change values in Replicated Storage/Server Storage with a local script on the client without using Remote Events/Functions

3 Likes

That of the remote functions was the only thing I got that works, but it also doesn’t work in StarterGui I don’t know why even the bool is there.

1 Like

Maybe you are simply changing it wrong. Mind shows how you attempted to change it?

1 Like

game.StarterGui.Value* = true

*located in StarterGui

you can use bool values by local script, but in order to change its value, it needs to be parented to something that local scripts work in, like one of the following objects:

  • A player’s backpack, such as a child of Tool
  • a player’s character model
  • a player’s playerGui
  • a player’s starterScripts
  • the ReplicatedFirst service

if both the boolvalue and localscipt are neither children of these objects, you cant change the boolvalue client sided. checking out this link on LocalScripts will give you more info on what LocalScripts main function of use is.

5 Likes

I didn’t know that, thanks to help

That is also not how you change Values or define objects in Local Scripts.

We use:

game.ReplicatedStorage.BoolValue.Value = true

in Server actions.

On the client
We use:

script.BoolValue.Value = true

Additionally, we dont modify objects in StarterGui in Game. In a game, the starter Gui gets copied to the player GUI which is where you would need to change objects for them to be seen.

The “script.BoolValue = true” dont work in PlayerGui, maybe this is a studio bug?

that would only work if the boolvalue is parented to the LocalScript

Nope, if you have a bool Value inside the script do:

script.BoolVaue(BoolValueName).Value(Value) = true(new Value)

The BoolValue can be parented anywhere, it doesn’t have runtime restrictions like LocalScripts. So long as the container is replicated to the client, it’s a valid location. Put the BoolValue where it best makes sense but the LocalScript must be placed in an appropriate container as per documentation.


No, this is your own code. You aren’t setting Value to true so you’re trying to make an object equal to something which is invalid.

1 Like

I hadn’t even noticed that there was this error, but even if I correct it, it will still give an error.

Whats is the error in the output?

can you give the error output and take a snapshot of where the BoolValue and LocalScript instance is in the explorer?

You either need to place the Bool Value inside the script or do

script.Parent.BoolValue.Value = true
script.parent.BoolValue

this is what you should use to find the BoolValue in the LocalScript.

because I was wrong I mistakenly put the bool on the side instead of inside, thanks

but there is still one more strange thing -_-