|
| 07 Apr 2016 11:32 PM |
first off i wanna say that i know im probably going to get this function
function id(num) if type(num) ~= "number" then return end local sets = game:GetService("InsertService"):GetUserSets(num) for k, v in next, sets do if v.Name == "My Models" then return v.CreatorName end end end
or an httpservice thing. but i cannot use either in this situation my reasons being a) i don't like relying on http requests (even though the function above counts as an http request oh well) and b) this function has an odd error on some users that are actually playing my game and it is causing issues
a prime example would be:
errors: print(id(8033963)) works: print(id(22753))
is there ANY other way to do this? or at least a way to "fix" this function? |
|
|
| Report Abuse |
|
|
|
| 07 Apr 2016 11:34 PM |
function getname() local player = game.Players:GetPlayerByUserId(28354663) return player end
local name = getname() print(name)
|
|
|
| Report Abuse |
|
|
|
| 07 Apr 2016 11:38 PM |
| the problem here is that im using this for when the player isn't in the game most of the time. i have a leaderboard that updates by userid and then displays the actual username on the leaderboard using that id function |
|
|
| Report Abuse |
|
|
|
| 07 Apr 2016 11:39 PM |
Pretty sure it works with players who aren't in-game.
"leaderboard that updates by userid"
Just use the id here in the code I gave you.
|
|
|
| Report Abuse |
|
|
| |
|
|
| 07 Apr 2016 11:42 PM |
Ah, I see what you mean now just tested it use this function off game.Players instead:
function getname() local player = game.Players:GetNameFromUserIdAsync(35485797) return player end
local name = getname() print(name)
|
|
|
| Report Abuse |
|
|
|
| 07 Apr 2016 11:43 PM |
| this one works, thank you lol |
|
|
| Report Abuse |
|
|
RoQuick
|
  |
| Joined: 12 May 2013 |
| Total Posts: 595 |
|
| |
|