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

Click detector not changing boolean value?

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

0

try this v2 = script.Parent.Parent.LockedV and then do v2.Value = true

0

didn't work :/

0

wait nvm thanks!

1 answer

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