I am making a gamepass that will allow people to see my beta game, if they don't have it they will be kicked. But, I want to make it so a certain group rank can still play without the gamepass, such as the developers. Can someone help? I'm bad at this stuff, lol.
this is what I tried, but it does not work.
local MPS = game:GetService("MarketplaceService")
local ID = 11377785
local Player = game:GetService("Players").LocalPlayer
game.Players.PlayerAdded:Connect(function(plr)
if MPS:UserOwnsGamePassAsync(plr.UserId,ID) then
elseif Player:GetRankInGroup(5791590) <= 255 then
else
plr:Kick("You do not own the required gamepass.")
end
end)

3 comments
How is it not working? Any errors?
Remember to pcall Async functions
It did not show any errors