Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

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

Asked by
pwnd64 106
9 years ago

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.

0
Please put your code in a code block YellowoTide 1992 — 9y
0
done, sorry - didnt know they existed pwnd64 106 — 9y
0
You forgot to put .Value like "game.Workspace.PartA.ValueA.Value" XToonLinkX123 580 — 9y

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

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
0
thanks, I'll try this tomorrow. pwnd64 106 — 9y
0
It works! Thanks a lot dude! pwnd64 106 — 9y
0
No problem Shawnyg 4330 — 9y
Ad

Answer this question