I am trying to make a button that only works when the player is in the group. I kinda looked through the DevHub, and mixed some code with another video that showed me how to work with group IDs and minimum ranks. Here is the code I have.
local clickDetector = script.Parent.ClickDetector
local exitDoor = game.Workspace.entrancedoor
local groupId = 5879349
local minRank = 253clickDetector.MouseClick:Connect(function()
game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(groupId) == >= minRank then
exitDoor.glassdoor.Transparency = 1
exitDoor.glassdoor.CanCollide = false
end
end)
end)