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

How do you lock door for some people and some not?

I want to make a office for my group, and I have builded the area, but how do you let in a office that some people get in and some don't. For exampel a guest shouldent come in, but an admin should. How do I do that?

Any suggestions

Sincerely,

Ducksneedhelp

2 comments

1

use collision groups

0

What do you mean?

2 answers

Make a table of the list of people you want to so for e.g. Make a part Rename part to Door

while true do
wait (1)
game.Players.PlayerAdded:Connect(function(plr)
local tab = { "PLAYER1" , "PLAYER2"}
for _,v in pairs(tab) do
if plr.Name == v then 
workspace.Door.CanCollide = false
wait (2) -- waits the number you tell it to.
workspace.Door.CanCollide = true
end
end
print "Yes"
end
end
end

end)

2 comments

0

I tried the script, and it dosent work

0

What doesnt work? Make sure its in a part called Door and make sure its server sided.

Use if statements like

--code
if (Player) .Level = 5 then
--code

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