Certain Rank Can Join the Game

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

I wan’t to achieve an rank only game, that when an player with an certain rank can join the game but if he doesn’t have the rank needed he will get kicked out of the game.

  1. What is the issue? Include screenshots / videos if possible!

The issue is that I’ve tryed finding tutorials but I didn’t find any that wpuld be helpfull.

  1. What solutions have you tried so far?

I’ve trid an code, but it didn’t work, it gave me some errors, soo that’s why I am coming here.

3 Likes

If you enter into the roblox beta program, there’s a feature to do this in Game Settings once enabled in studio after signing up with the roblox beta program. It’s very simple doing so this way, after opting in it should show this in Game Settings:

(It works for public games and private games, I just have my game on private as it’s a test and I’m not intending to release this game)

What code did you try???

This is only when the game is private. And you can’t vote private game. So it is good solution for something for few people, but bad solution for open game.

2 Likes

It isn’t only for private games, it also works for public games. I just have my game on private as it’s a test, not a game I’m intending to release.

1 Like

You can get rank by this function Player | Documentation - Roblox Creator Hub and then compare it with ranks, that have permission to enter.

As @mistr88 said, if you have a group, you can use GetRankInGroup to check if a player’s rank in the group is less than a specific rank. If so, kick them from the game, else, let them in.

local Players = game:GetService("Players")
local GroupID = 0 -- replace this with your group id
local GroupRank = 2 -- the mininum group rank. this can be assigned between 0 and 255. 

Players.PlayerAdded:Connect(function(player)
	if player:GetRankInGroup(GroupID) < GroupRank then
		player:Kick("You have been kicked from the game.") -- kick them
	end
end)
17 Likes