Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Attempt to concatenate field a boolean value?

I was wondering if anyone can tell me what I'm doing wrong as why A is working and B isn't? Sorry it's kinda hard for me to explain it. ._.

Script that works(A):

print(game.Workspace.FilteringEnabled)

Script that doesn't work(B):

print("FilteringEnabled: "..game.Workspace.FilteringEnabled)

Any help appreciated.

2 comments

0

Could you describe what the "FilteringEnabled" object of the workspace is. Try using "game.Workspace.FilteringEnabled.Name".

1 answer

✓ Accepted answer
local filtBool = game.Workspace.FilteringEnabled  -- Get the value of 'game.Workspace.FilteringEnabled'

if filtBool then  -- 'if filtBool == true then'
	filtBool = "true"
elseif not filtBool then  -- 'if filtBool == false then'
	filtBool = "false"
end

print("FolteringEnabled: " .. filtBool")

Bools can't be concatenated. Only numbers and strings. Sorry fam.

This discussion is preserved as it was. New answers, comments, and votes are closed.