How would I code a admin only door

Now before u guys go saying “just look it up stupid” I tried and I didnt see much that would help me. I don’t want it a normal admin door tho I want it when your joining to check if you are a admin then delete the part locally if you are do you get it?

1 Like

This can help you Restricted/Team Doors.

2 Likes

You can use GetRankInGroup:

local GroupID = 9128327
local Rank = 255 
game.Players.PlayerAdded:Connect(function(Player) --On Player join
	if Player:GetRankInGroup(GroupID) == Rank then --Check Player Rank
		print("Player is Admin") --He has or is above the Rank
	else
		print("Player is not Admin") --He does not has or is above the Rank
	end
end)
2 Likes

Here’s the thing I only wanna delete the part for 1 person so I might just fool around with these:

1 Like

I would use a simpler method:

Put this in a Script and the Script in a Part. It will open if the Player got the Rank in the Group, else it is closed.

local GroupID = 9128327
local Rank = 254 
script.Parent.Touched:connect(function(hit)
	if (hit and hit.Parent and game.Players:FindFirstChild(hit.Parent.Name)) then
		if (game.Players[hit.Parent.Name]:IsInGroup(GroupID) and game.Players[hit.Parent.Name]:GetRankInGroup(GroupID) >= Rank) then
			print("Player is Admin") --He has or is above the Rank
			script.Parent.CanCollide = false
			script.Parent.Transparency = .9
			wait(.5)
			script.Parent.CanCollide = true
			script.Parent.Transparency = 0
		else
			script.Parent.CanCollide = true
			print("Player is not Admin") --He does not has or is above the Rank
		end
	end
end)
1 Like

I don’t want people to be able to walk in when the other person does I just wanna do the other method rn.

1 Like