I made a script to put inside an admin door and everytime I touched the door, it said in the output
attempt to index nil with 'GetRankInGroup'
So, I'm really confused, here is my script:
local adminDoor = script.Parent
local Players = game:GetService("Players")
adminDoor.Door.Touched:Connect(function(hit)
local char = hit.Parent
local player = Players:GetPlayerFromCharacter(char)
local rank = player:GetRankInGroup(5567779)
if rank >= 3 then
game.ReplicatedStorage.AdminFound:FireClient(player)
elseif rank < 3 then
adminDoor.Door.CanCollide = true
end
end)
