local Clickdetector = script.Parent.ClickDetector
local plr = game.Players.LocalPlayer
function Clicked()
if plr.Name == script.Parent.Value.Value then
script.Parent.Transparency = 1
end
end
Clickdetector.MouseClick:Connect(Clicked)
COMMUNITY QUESTION
Why doesn't my "if player.Name == X then change propertie" script work? It is in a local script
1 answer
Use Script and put into part u want to click
script.Parent.ClickDetector.MouseClick:Connect(function(plr)
if plr.Name == script.Parent.Value.Value then
script.Parent.Transparency = 1
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
Try to debug it (add Print Statements)
Maybe try local function Clicked()
Ànd what is script.parent and script.parent.value.value?
Local functions are just style. only matters for variable scope
I have debugd and it didn't prin at the seconde line
It is a value in a stringvalue that is in a part