Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How do I get the username from a username ID?

Asked by 10 years ago

I don't just want a link to a proxy or third-party API or even ROBLOX's API; can you show me how to use it in a script?

3 answers

Log in to vote
0
Answered by 10 years ago

When scripting, you only use the last several digits of the username, if this is what you mean.

To target a SPECIFIC ITEM, you usually enter it like this.

187846561

But the whole script is the whole line at the top, some gamepasses require this method of insertion

http://www.roblox.com/Neon-Purple-Animal-Hoodie-item?id=187846561

If you want a SPECIFIC player to have, let's say Kohls Admin, you enter their username (CaSe SenSiTIvE) into a script. For example, we'll use the 'admins' dialogue.

local admins = {"UsErNaMeHEre"} -- Gives a user Administrative access, replace UsErNaMeHEre with the desired username.

To grant a user's ID entrance (VIP Doors) you need the last numbers of their ID.

To grant a Shirt in, you need to have the last numbers of their ID, to grant a GamePass in, you need to have the whole ID

PassOrShirtID = 114508316  -- Change this to your asset/shirt/badge/pass ID

I hope I helped with your problem. If you need more clarification, PM me on ROBLOX.

Accept this if I helped.

Ad
Log in to vote
0
Answered by 9 years ago

Well just to be nice here you go!

local function GetUsernameFromId(ID)
    ID = tonumber(ID) -- make sure its a number...

    if ID and ID > 0 then -- make sure it exists and is > 0
        local data = game:GetService('InsertService'):GetUserSets(ID) -- Fetch sets that the user has
        if data then
            local list = data[1] -- the first value, P.S. it does not have to be 1 I set it to 1 because it normaly allways exsists
            if list then -- just to make sure
                local name = list['CreatorName'] -- the username index
                if name then -- just to be safe
                    return name
                end
            end
        end
        return 'Guest' -- Defaults to Guests because their IDs are below 0
    end
end

function used: GetUserSets

I am sure this is what you wanted....

Enjoy!

Log in to vote
-1
Answered by 10 years ago

sinking to the bottom

0
There isn't a "bump" functionality on this website; that wouldn't make sense. BlueTaslem 18071 — 10y

Answer this question