Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Made by YourFriendlyCanadian, Subscribe https://www.youtube.com/channel/UCYZcX-vX1qO-OkZfMwsNUgA
- var placeId = 385476777; // Place to check and message
- var waitTime = 10; // In seconds
- var group = 0; // 0 for no group check, otherwise people in this group will not receive the message
- function sendMsg(userId, username) {
- function send() {
- $.post("https://www.roblox.com/messages/send",{
- subject: 'Hey, ' +username+ '! Looking for some top tier designer clothing?',
- body: 'Hello, ' + username + '. \n\nI saw you earlier today and you seemed really fashionable! \nI think that you would really fit in with the crowd in this group called Flexing! \n\n(https://www.roblox.com/My/Groups.aspx?gid=2888544) \n\nIf you would like to see some of our work, go to this link: https://www.roblox.com/catalog/browse.aspx?IncludeNotForSale=false&SortType=3&CreatorID=144200148. \n\nHave a great day!',
- recipientid: userId,
- cacheBuster: new Date().getTime()
- }).done(function(response) {
- if (response.success == true) {
- console.log('Sent message to ' + username + ' (' + userId + ')');
- } else {
- console.log('Error sending to ' + username + ': ' + response.shortMessage);
- }
- });
- }
- if (group > 0) {
- $.get("https://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=" + userId + "&groupid=" + group, function(response) {
- if(response.indexOf('true') == -1) {
- send();
- } else {
- console.log('Didn\'t send a message to ' + username + ' because he is already in group ' + group + '.');
- }
- });
- } else {
- send();
- }
- }
- var i=0;
- function run() {
- var timeout = 0;
- var url = "https://www.roblox.com/games/getgameinstancesjson?placeId=" + placeId +"&startindex=" + i*10;
- $.get(url).done(function(obj){
- for (var server in obj.Collection) {
- for (var players in obj.Collection[server].CurrentPlayers) {
- var plr = obj.Collection[server].CurrentPlayers[players];
- if (plr.Id > 0) {
- (function(time,id,name) {
- setTimeout(sendMsg,time,id,name);
- })(timeout,plr.Id,plr.Username);
- timeout+=waitTime*1000;
- }
- }
- }
- i++;
- setTimeout(run, timeout);
- });
- }
- run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement