Greetings! After searching a lot on the Roblox Developer forum, I found out how to write this:
local HttpService = game:GetService("HttpService")
game:GetService("Players").PlayerAdded:Connect(function(Player)
local DevForumURL = "https://devforum.rprxy.xyz/u/".. Player.Name..".json/"
local Success, TrustLevel = pcall(function()
return HttpService:JSONDecode(HttpService:GetAsync(DevForumURL)).user.trustlevel
end)
if Success then
if TrustLevel >= 1 then
print("Player, ".. Player.UserId.. "Is allowed")
else
Player:Kick("This version of the game is only avilable to Roblox Developers, as this is a Developer Beta.")
end
else
Player:Kick("Error checking trust level on Roblox Developer Forum.")
end
end)
I am trying to make my game Developer Forum Member only. It may sound silly at first, but I do not want the average player playing Developer Betas, as they are unfinished, and can tend to be very buggy.
The problem with this script is that it kicks after checking with the pcall
, saying it failed to check the trust level.
If you can help make my game DevForum member only, that will be appreciated!
Thanks in advance!