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

How do make it so only specific players can use a click detector?

Asked by 5 years ago
Edited 5 years ago

I would like to know how to make it so only specific players can use click detector or run a script like this one.

door = script.Parent;
locked = true

function setform(v)
locked = v
if v then
door.Transparency = 1
door.Reflectance = 0.4
door.CanCollide = true
else
door.Transparency = 0.7
door.Reflectance = 0
door.CanCollide = false
end

end


function click()
if locked then
setform(false)
wait(5)
setform(true)
end
end

door.ClickDetector.MouseClick:connect(click)

1 answer

Log in to vote
0
Answered by 5 years ago

You could do it like this

script.Parent.MouseClick:Connect(function (player)

    if player.Name == "GarrettlovesGTA" then

        --code

    end

end)
0
does not work:( GarrettlovesGTA -1 — 5y
0
you have to put the script into the click detector MageMasterHD 261 — 5y
Ad

Answer this question