Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why doesn't my "if player.Name == X then change propertie" script work? It is in a local script

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)

6 comments

0

Try to debug it (add Print Statements)

0

Maybe try local function Clicked()

0

Ànd what is script.parent and script.parent.value.value?

0

Local functions are just style. only matters for variable scope

0

I have debugd and it didn't prin at the seconde line

0

It is a value in a stringvalue that is in a part

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.