Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
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)
0
Try to debug it (add Print Statements) RedstonecraftHD 25 — 4y
0
Maybe try local function Clicked() Skydoeskey 108 — 4y
0
Ànd what is script.parent and script.parent.value.value? Skydoeskey 108 — 4y
0
Local functions are just style. only matters for variable scope royaltoe 5144 — 4y
View all comments (2 more)
0
I have debugd and it didn't prin at the seconde line Blixtcraft 16 — 4y
0
It is a value in a stringvalue that is in a part Blixtcraft 16 — 4y

1 answer

Log in to vote
0
Answered by
G2001H 75
4 years ago

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)

Ad

Answer this question