I need to give some context, the script is inside a button part, and the click detector is in a part called "ButtonActivate". The Button Part is called ButtonThing and Button Thing is inside a model with ButtonActivate, and the model is in a folder called Button. I want to make it so that when you click on the button activate, the ButtonThing's transparency is equal to 1, but my script doesn't work. (I'm new to scripting btw)
The script that doesn't work:
function OnClick() script.Parent.Transparency = 1 end script.Parent.Parent.ButtonActivate.ClickDetector:connect(OnClick)
The problem is that you weren't actually detecting when the player clicked on the button. Try this instead:
local clickDetector = script.Parent.Parent.ButtonActivate.ClickDetector clickDetector.MouseClick:Connect(function() script.Parent.Transparency = 1 end)
hey you! have you ever heard of enes? if you are in trouble, better call enes!