Click Detector for Client

I am making a Find the Pots game, and one of them requires a button. I put this LocalScript in StarterPlayerScripts, what’s wrong?
Edit: It’s in a LocalScript because I only want the player who touched the button to get it.

local button = game.Workspace.Button

button.ClickDetector.MouseClick:Connect(function(Player)
	if button["Activated?"] == false then
		button["Activated?"] = true
		button.Material = Enum.Material.Neon
		button["vine boom"]:Play()
		game.Workspace.Pots["Red Pot"].CanTouch = true
		game.Workspace.Pots["Red Pot"].Decal.Transparency = 0
		game.Workspace.Pots["Red Pot"].Face2.Transparency = 0
	end
end)
``
1 Like

The Activated value is like a debounce correct?

1 Like

Yes, but it can’t be activated twice. Technically, it’s a forever debounce. Upon joining the game, the debounce is false.

1 Like

What is the [“Activated?”] instance? If its a bool value, your literally changing the instance into the boolean itself.

…Oh. Whoops. I didn’t see that, and I always make that mistake. Thanks.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.