sentanos / roblox-js

!!!THIS PROJECT IS NO LONGER MAINTAINED!!! Execute ROBLOX website actions in node.js
MIT License
45 stars 46 forks source link

ROBLOX-JS GETPLAYERS ISSUE #99

Open connorishere opened 6 years ago

connorishere commented 6 years ago

I want to get all users in the group then console.log the array. https://github.com/sentanos/roblox-js/wiki/Group-Functions#getplayers <--- That's the function i'm trying to use, I get this error http://prntscr.com/j8cbr2 rbx.getPlayers(2868558) .then(function (group) { console.log(JSON.stringify(group.players.lenght)); });

ghost commented 6 years ago

The following code will print each member's name and the amount of members in the group.

var promise = rbx.getPlayers({
group: GroupID
});
promise.then(function (plrs) {
 console.log(plrs.players.length + " members in your group!")
 for(var i= 0; i < plrs.players.length; i++){
 console.log(plrs.players[i].name)
 }
})
Zlecktov commented 6 years ago

An issue you might be having is inside JSON.stringify you put group.players.lenght instead of length*