How do I let in DevForum members only?

Hello Guys!
I have a doubt about how to let DevForum members only in,
I need help with some scripting, Let me explain my self:
So, I am making a game to let DevForum members only in, The people that are NOT in the Developer Forum can NOT get in, But I don’t know how to make that.
I would like to make Youtubers only too…
Could someone tell me please how to make it?
Thanks!

1 Like

Do you mean only people who are in DevForum can join a group? If yes, you need some external website/bots.

1 Like

Hmm, No,
I mean in a Game to let the people in, not in a Group.

Takes an API request to an endpoint to check if someone is on devforum. I’m not sure which endpoint this is since roblox doesn’t have a widely documented API in a single spot.

2 Likes

You should create a website or something that is 24/7 online, and then make a GetAsync post using HttpService.

You would use the discourse api, (Ill probably code a quick one in 10 mins or so and post it here), Then return the data from it if it is true / false.

game.Players.PlayerAdded:Connect(function(Player)
if not Player:IsInGroup(3514227) then
Player:Kick("You must be in group (3514227) to join.")
end
end)

The only problem with this is that you’ll still get lots of people trying to join, and this will lead to dislikes since they’re still joining the game but are being kicked instantly, however as off now there is no other way to do this unless you make the game under the DevForum group.

5 Likes

That would only work if they are in the group. There is many users who arnt in the Devfourm Group.

Ok, Do you know the RDC’s Games?
Like there are some walls and Only DevForum members can get in (I think it needs a Script)
That’s what I want to make…

Well I have provided you with a link that works.

Yeah you’re right, but if this was to be a full game he’d still have the problem of normal players constantly trying to join.

Thank you!
I hope this is the Script! <3

Discourse updated their API so it would cause an error most likely.

I could add the same script with all the DevForum groups.

That script linked is a proxy, Not an actual devfourm script, You would need to make ur own or use the API directly.

1 Like

This is not a reliable method. That group is not official and is not guaranteed to accept just Devforum members or even to accept Devforum members (the bot’s currently having issues where it won’t accept some people).

Quick mockup of how you’d do it using a more reliable method (@incapaxx’s doesn’t seem to work either):

local HS = game:GetService"HttpService"
local Url = "https://devforum.roblox.com/u/%s.json"
local Proxy = "https://cors-anywhere.herokuapp.com/"

local function GetTrustLevel(name)
	local res = HS:RequestAsync({
		Url = Proxy .. Url:format(name),
		Method = "GET",
		Headers = {
			["X-Requested-With"] = "XMLHttpRequest"
		}
	})
	if not res.Success then
		return "None" --no account or error
	end
	
	local json = HS:JSONDecode(res.Body)
	
	return tonumber(json.user.trust_level) -- 0 = non-member, 1= member, 2 = regular, etc
end

print(GetTrustLevel("Kiriot22"))
8 Likes

Hmm…
I am trying to get in but It doesn’t let me get in.
Do I need to trun CanCollide off?

My function won’t actually kick or set CanCollide or anything, it just returns a number for their trust level. If you want to let people in who are members, just check if GetTrustLevel(name) is greater than 0 and kick them if not. If you’re going to kick non-members, there’s no reason to have any parts trying to keep them out in the first place.

If this is supposed to just be a special area for Devforum members only, just use FireClient to tell them to turn CanCollide off, yeah.

2 Likes

Do you mean like only let DevForum & Youtubers only in like IN A GAME or like in a group because if its in a game you just need to create a simple script with the group ID and ranks but if its a group you actually need a website/bot to do that.

In a game…
I don’t want to create a group fir DevForum members only… And I don’t think I can make a group of that…