Hey guys i have a script which prints turned on how would i make it to where it will print turned off when i click it again here is the code i can't figure it out.
(When i click it i want it to print clicked on and when i click it a second time i want it to say clicked off)
button = script.Parent
cl = Instance.new("ClickDetector",button)
clicked = false
button.ClickDetector.MouseClick:connect(function()
if clicked == false then
clicked = true
print("Clicked on")
print("Clciked off") --having trouble here
clicked = false
end
end)

3 comments
What are you trying to do? Make it just print "Clicked on", "Clicked off"?
(When i click it i want it to print clicked on and when i click it a second time i want it to say clicked off)
Ok.