function getUsername() {
$.get("http://www.roblox.com/mobileapi/userinfo", function(data) {
return data.UserName;
});
}
console.log(getUsername());
It says "undefined" but whenever I visit the link manually it shows
{"UserID":74798521,"UserName":"AbstractMadness","RobuxBalance":7024,"TicketsBalance":21530,"ThumbnailUrl":"http://t2.rbxcdn.com/c189198f6c0689ce004d9438c70eb1bb","IsAnyBuildersClubMember":true}
It will also log the name if I do console.log(data.UserName) inside of the function.