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

How do I get the name of the creator of a place?

Asked by 8 years ago

I want to get the name of the creator of the place, using game.<childnamehere>, but I can't find anything other than the CreatorId. I want to know if there is a way of getting the name of the creator, without using HTTP (HTTP is accessing websites, and deriving/adding information to/from them).

Can any help me with this?

0
Why not just use the game owner's UserID? game.CreatorId shayner32 478 — 8y
0
But that would mean using HTTP, which I don't want. Do you read? UserId does not give you a name TheDeadlyPanther 2460 — 8y
0
How is this a bad question? Don't downvote me if your not knowledgable enough in RBLX Lua to answer my question. TheDeadlyPanther 2460 — 8y

1 answer

Log in to vote
1
Answered by
4Bros 550 Moderation Voter
8 years ago

You can use InsertService to get the name of a person from their userid by using this neat trick instead of HttpService.

function UsernameFromID(ID)
    local sets = (type(ID) == "number" and game:service("InsertService"):GetUserSets(ID)) or nil
    if sets then
        for i, v in next, sets do
            if v.Name == "My Models" then
                return v.CreatorName
            end
        end
    else error("ID must be a number")
    end
end

print(UsernameFromID(261)) --- Shedletsky
Ad

Answer this question