basically this script is connected to a button when i click the button its suppose to make a brick dissapear and the button will change to red but it doesnt it just stays green it doesnt work in play mode and it used to work in play mode but for some reason when i test it in roblox studio it works.

Debounce=false
function onClicked()
	if not Debounce then
		Debounce=true

	script.Parent.BrickColor=BrickColor.new("Really red")
	Workspace.invisibleD.Transparency=1
	Workspace.invisibleD.CanCollide=false
	wait(3)
	Workspace.invisibleD.Transparency=0
	Workspace.invisibleD.CanCollide=true
	wait(5)
	script.Parent.BrickColor=BrickColor.new("Lime green")
	Debounce=false
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

Please Help.

7 comments

0

I see no errors. Any output?

0

no output errors no

0

Is there, in fact, a ClickDetector sharing the same parent as this script?

1

Also, please remove the sort of bribe from your question. You are not allowed to provide compensation, as said in the rules. "Providing compensation for answers is not allowed." If you don't remove it, I will report this post.

0

^

0

So sorry didn't know there was rules excuse me for my carelessness.

0

Yes there is a ClickDetector sharing the same parent as this script.