So this is a advanced (kinda) group door script.. Here's the server script:
game.Players.PlayerAdded:connect(function(plr) game.ReplicatedStorage.OpenGDoor:FireClient(plr) end)
And here's the client script:
game.ReplicatedStorage.OpenGDoor.OnClientEvent:connect(function(plr) if game.Players[plr]:GetRankInGroup(3327521) >= 2 then -- This is where it errors out workspace.GroupDoor:Destroy() end end)
welp...
because OnClientEvent doesn't give us a plr value we can just use game.Players.LocalPlayer because its a localscript
game.ReplicatedStorage.OpenGDoor.OnClientEvent:connect(function() if game.Players.LocalPlayer:GetRankInGroup(3327521) >= 2 then workspace.GroupDoor:Destroy() end end)
Also you shouldn't use that plr variable like players[plr] to get the player, you should either just use plr.Character or game.Players:FindFirstChild(plr.Name).Character to get to the player because [] is used with strings for example workspace["testing 123'].PrimaryPart