now there will be a problem and that is the players character is named the same thing so you could do a.Name = (player.Name…“s bool value”)
and then workspace:WaitForChild(player.Name…“s bool value”)
If you want to get the character, then you do workspace:WaitForChild(player.Name) in script2, as this will wait for a child in workspace with the same name as the player. You put a string value in WaitForChild to do this (in this case being player.Name).
Some criticism I would give is that you should always do game:GetService("Players") instead of game.Players. Do this for every service except workspace, as that is already a variable. As well as this, when creating an instance, you should set the parent of it AFTER you set the values to it. The reason why can be seen in this post: PSA: Don't use Instance.new() with parent argument
:WaitForChild() can be used to wait for a child that’s being cloned, such as the player’s PlayerGui, and it’ll be automatically defined once added. If the child wasn’t added for a long time, a warning outputs as it yields for it (waits).
If you want to define the player’s character, I suggest using Player.CharacterAdded event - that way it’ll fire every time they respawn/reset, and in case you have a statue of yourself in workspace.