"Boolvalue is not a valid member of Workspace "Workspace""

Ello! I’m Tony! I’m working on a game with a couple of friends called Brick Fights. One of my friends wrote a script and and it doesn’t seem to work. (We all have like no scripting knowledge.) The error I have is “BoolValue is not a valid member of Workspace “Workspace”” Thanks in advance!

Script:

lobbyteamsize = game.Workspace.LobbyTeamAmmount
Value = game.Workspace.BoolValue

while true do
	if lobbyteamsize.Value > 1 then
		Value = true
	else
		Value = false
	end
end

Try doing

local lobbyteamsize = game.Workspace.LobbyTeamAmmount
local Value = game.Workspace.BoolValue

while true do
	if lobbyteamsize.Value > 1 then
		Value.Value = true
	else
		Value.Value = false
	end
end

Oh mah gosh
Change

Value = game.Workspace.BoolValue

To

local Value = game.Workspace.BoolValue

Don’t use global variables (Use local ones more often)

1 more thing, you’re just getting the BoolValue Instance and not the BoolValue’s Value

Fixed:

local lobbyteamsize = game.Workspace.LobbyTeamAmmount
local Value = game.Workspace.BoolValue

while wait() do
	if lobbyteamsize.Value > 1 then
		Value.Value = true
	else
		Value.Value = false
	end
end

My brain stopped responding at the time I finished this post, I had to re-edit it 3 times

if lobbyteamsize.Value > 1 then
    Value.Value = true
else
	Value.Value = false
end

Also I encourage using local variables

oh my gosh i forgot to make it local

One more thing, this:

while true do
	if lobbyteamsize.Value > 1 then
		Value.Value = true
	else
		Value.Value = false
	end
end

Will 99.9% crash your Studio without a doubt, so you may wanna consider adding a wait() in there

i legit still got the same error

local lobbyteamsize = game.Workspace.LobbyTeamAmmount
local Value = game.Workspace.BoolValue

while wait() do
	if lobbyteamsize.Value >1 then
		wait(1)
		Value.Value = true
	else
		wait(1)
		Value.Value = false
	end
end

W a i t
image
*Is there even a BoolValue named “Boolvalue” in workspace- o_o

i would assume he put one in there. checking right now
edit: oh my god, well that explains it

LOL IT’S FINE, mistakes like these can happen :sweat_smile:
But yeah, also make sure to keep in mind the other posts members have said on here for good practice

well, thanks for helping me. im dumb it turns out :man_facepalming:

1 Like