I have a script in a part thats in workspace. In that part I have a boolvalue and a script and I want the script to detect when the boolvalue is true.
code in script
while true do if script.Parent.Value.Value == true then print("OMG IT WORKED") end wait() end
Isn't working, please tell me why
I think the problem is because you aren't providing the boolvalue's name in the script, try switching the first .Value for .BOOLVALUENAMEHERE like this:
while true do if script.Parent.BOOLVALUENAMEHERE.Value == true then print("OMG IT WORKED") end wait() end
Use the Changed Event
script.Parent:WaitForChild("Value").Changed:Connect(function(newvalue) if newvalue then print("OMG IT WORKED") end end