This is my script. I have it in a server script in a door lock. When I click it, it prints ("locked") and ("unlocked"), but it is not changing the boolean value.
local v2 = script.Parent.Parent.LockedV.Value
local v3 = script.Parent.Parent
function onClicked()
if v2 == false then
v2 = true
print("locked")
elseif v2 == true then
v2 = false
print("unlocked")
end
end
script.Parent.ClickDetector.MouseClick:Connect(onClicked)

3 comments
try this v2 = script.Parent.Parent.LockedV and then do v2.Value = true
didn't work :/
wait nvm thanks!