Communicating with an External API
httpGet
// Executes when a player enters
App.onJoinPlayer.Add(function (player) {
App.httpGet(
"https://nickname.hwanmoo.kr/?format=json&count=1&max_length=6&whitespace=_",
null,
function (res) {
// Change the response to a json object
let response = JSON.parse(res);
player.name = response.words[0];
player.sendUpdated();
}
);
});httpPost
Last updated
Was this helpful?
