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)
Try this one here it should work
local MarketPlaceService = game:GetService("MarketplaceService") local GamepassId = 11377785 local GroupId = 5791590 local RequiredRank = 255 local KickMessage = "You do not own the required gamepass." game.Players.PlayerAdded:Connect(function(player) if not MarketPlaceService:UserOwnsGamePassAsync(player.UserId, GamepassId) and player:GetRankInGroup(5791590) <= 255 then player:Kick(KickMessage) end end)
tell me if it works