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

How do I make BoolValues from a script interact with another script?

So I'm making a terminal to capture, and I want to make it so when you step on it it sets a boolvalue to true, and when you touch all 3 terminal points it turns all 3 boolvalues to true (If that makes sense). After that I want a separate script to start a timer, but my problem is that it won't recognize the bools from the other script.

Does anyone know how this would work? I have tried the following, but it probably shouldn't work anyway.

local ValueA = game.Workspace.PartA.ValueA
local ValueB = game.Workspace.PartB.ValueB
local ValueC = game.Workspace.PartC.ValueC
if ValueA and ValueB and ValueC == true then
print'yay'
end

This doesn't end up printing anything. Thanks for stopping by, and thanks if you answer.

3 comments

0

Please put your code in a code block

0

done, sorry - didnt know they existed

0

You forgot to put .Value like "game.Workspace.PartA.ValueA.Value"

1 answer

✓ Accepted answer

Well, with "and", it's basically adding another if statement, so you still need to put == true within each statement, if that makes sense. So...

local ValueA = game.Workspace.PartA.ValueA
local ValueB = game.Workspace.PartB.ValueB
local ValueC = game.Workspace.PartC.ValueC
if ValueA.Value == true and ValueB.Value == true and ValueC.Value == true then
	print'yay'
end

3 comments

0

thanks, I'll try this tomorrow.

0

It works! Thanks a lot dude!

0

No problem

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