Hello all,
I’ve been planning to make a custom leaderboard/PlayerList system that is basically identical to the current roblox one (but with a few behind the scenes differences), I know how to check if a player is an admin or a star creator because that’s just checking if they are in group, but the issue comes when checking if a player has developer access to a game. Of course it’s easy enough if it’s a group game and that’s managed on a role/rank system (to check if they’re rank is above 200, for example), but when it comes to player-owned games the only way I can find tutorials on is having a custom table/module with playerIds listed which is all manual, I’m looking for a way to check if the player can edit in studio, give them a boolValue
in their player
that will indicate that they are a dev without the need to edit a list each time a dev comes and goes from the project.
How have I tried to solve this so far then? I have done a massive dive into the Roblox CoreScripts and have found various different things, but I’m not going to lie, most of that code is beyond my understanding. The Playerlist scripts seem to be referencing icons that I haven’t seen used in a while so either the ones on the github are outdated or it’s some sort of backwards compatibility.
My next thought was “How does the DevConsole know who can enter commands and view the server output?” So once again I went searching through the core scripts and found a function called isDeveloper()
so after messing around in studio with the code (mainly adding print statements) I figure out that one of the services it uses is locked to coreScripts…
local HttpRbxApiService = game:GetService('HttpRbxApiService')
local HttpService = game:GetService('HttpService')
local function isDeveloper(player:Player)
local canManageSuccess, canManageResult = pcall(function()
local url = string.format("/users/%d/canmanage/%d", player.UserId, game.PlaceId)
return HttpRbxApiService:GetAsync(url, Enum.ThrottlingPriority.Default, Enum.HttpRequestType.Default, true), "Checker1"
end)
print(canManageSuccess, canManageResult)
if canManageSuccess and type(canManageResult) == "string" then
-- API returns: {"Success":BOOLEAN,"CanManage":BOOLEAN}
-- Convert from JSON to a table
-- pcall in case of invalid JSON
local success, result = pcall(function()
return HttpService:JSONDecode(canManageResult), "Checker2"
end)
print(success, result)
if success and result.CanManage == true then
return true, "Checker3"
end
end
return false , "Checker4"
end
local result, a = isDeveloper(game.Players.IncredibleTeamAidan)
print(result, a)
Unfortunately the output is always:
-->false The current thread cannot call 'GetAsync' (lacking capability RobloxScript)
-->false Checker4
So… What’s the next step? One thing I see a lot of on the DevForum is that I should use a proxy to access the roblox API but I can only see ones for the standard HttpService
and not the specialised HttpRbxApiService
which this function requires.
I’m kinda at a loss so any help would be appreciated.
Thanks in advance, Aidan.