Boolean Value Not Changing?

I was just working on this simple script:

local block = script.Parent
local detectorvalue = game.Workspace.Chaser.Value
local detector = game.Workspace.Detector
function DetectorActivated()
	detectorvalue = true	
end
detector.Touched:Connect(DetectorActivated)

(This is in a local script)
I just want the script to toggle the Boolean value when I touch a part. However, when I touch it, nothing happens. I’ve checked the output and theres nothing wrong shown in there. Is there anything I’m doing wrong?

This might work


local block = script.Parent
local detectorvalue = game.Workspace.Chaser
local detector = game.Workspace.Detector
function DetectorActivated()
	detectorvalue.Value = true	
end
detector.Touched:Connect(DetectorActivated)
3 Likes

Lol thank you for the script. I didn’t actually paste it into my game, but after reading it, I realized that I had an extra unused variable and that I was parenting things wrong.

You are using an BooleanValue. So you was trying to set an boolean to a instance, what dosent works. And yeah, all Value Instance has an Value property, glad you understod it.