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

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

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

✓ Accepted answer

You could do it like this

script.Parent.MouseClick:Connect(function (player)
	
	if player.Name == "GarrettlovesGTA" then
		
		--code
		
	end
	
end)

2 comments

0

does not work:(

0

you have to put the script into the click detector

This discussion is preserved as it was. New answers, comments, and votes are closed.