MartinRBX

Developer API Module

Aug 20th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.23 KB | None | 0 0
  1. (Module is here: ' https://www.roblox.com/catalog/993003470/redirect ' )
  2.  
  3. --[[-- Developer API --]]--
  4.  
  5. --[[
  6. Welcome, you will here learn how to use my developer API Module for your own game!
  7.  
  8. General information :
  9. ----------------------
  10.  
  11. This is for developers who want to save their data to a server,
  12. or for developers who need to access the roblox' api.
  13. (Don't worry if you need it because of both of dem' reasons, it's still there for you ;))
  14.  
  15. If you need this, then this is the perfect choice for you!
  16.  
  17. Security is really important for everyone, that's why I am securing your information by encrypting it.
  18.  
  19. I want to make you feel comfortable making your choice if you want this or not,
  20. that's why I can guarantee all your data is saved within the second. Almost as fast as you can say "Hey".
  21.  
  22.  
  23. With easy set-up and instructions for this Developer API Module, you can set this service up within 1 minute.
  24.  
  25. If you use this for saving your data then as a non-premium member, you can still save in up to 15 places, with unlimited space.
  26.  
  27. Donations though, are appreciated.
  28.  
  29.  
  30. Premium membership only 50 Robux each 2 months, and you can pre order for as long time as you need or want to.
  31.  
  32. The prices will in the future be increased.
  33.  
  34.  
  35. Premium benefits:
  36.  
  37. -Even more secure
  38.  
  39. -Backups
  40.  
  41. -Priority saving, save faster
  42.  
  43. -Unlimited places
  44.  
  45. -Unlimited space
  46.  
  47. ---
  48. As non-premium member, you get:
  49.  
  50. -Save in up to 15 places
  51.  
  52. -Save fast
  53.  
  54.  
  55.  
  56. --]]
  57.  
  58.  
  59.  
  60.  
  61. --[[-- SETTING UP --]]--
  62.  
  63.  
  64. --[[
  65.  
  66. Alright, so the first thing we are going to do is requiring the module.
  67.  
  68. This is done by doing "local devAPI = require(993003470)"
  69.  
  70. The script will now look like this:
  71. --]]
  72.  
  73. ---
  74.  
  75. local devAPI = require(993003470)
  76.  
  77. ---
  78.  
  79.  
  80. --[[
  81.     If this is your first time in that place of yours, then it's time to Initiate it so the server can make space for your
  82.     data.
  83.  
  84.     To do this do:
  85.  
  86.     devAPI:Initiate()
  87.  
  88.     (If you haven't already, open your Output window) Now look in the 'Output' window. It will give you
  89.     your username and password, and if you're a premium member, your backup key.
  90.  
  91.     In your script add variables for these keys. They are essential to get access to your data.
  92.  
  93.     THE USERNAME AND PASSWORD WILL ONLY BE PRINTED OUT ONCE, REMEMBER TO STORE THEM SO YOU DON'T LOSE THEM!
  94.  
  95.     Now, your script should look somehow like this:
  96. --]]
  97.  
  98.  
  99. local devAPI = require(993003470)
  100.  
  101.  
  102. local Username = "xxxxxx";
  103. local Password = "xxxxxxxxxxxxxxx";
  104.  
  105. --[[
  106.  
  107.     Great, you have now put the login information to your script.
  108.  
  109.     Now you are done setting up your own data saver.
  110.  
  111.     Below here, I will drop examples of how to use.
  112.  
  113.     Note that you don't need username and password for accessing the Roblox API
  114.  
  115.        
  116.    
  117. --]]
  118.  
  119.  
  120. --[[-- Saving data --]]--
  121.  
  122.  
  123. local devAPI = require(993003470);
  124.  
  125. local username = "xxxxxx";
  126. local password = "xxxxxxxxxxxxxx";
  127.  
  128.  
  129. local YOUR_TABLE = {}
  130.  
  131. YOUR_TABLE["NAME"] = "SWORD"
  132. YOUR_TABLE["PRICE"] = 666
  133.  
  134. local saveData = devAPI:SaveAsync(username, password, YOUR_TABLE)
  135.  
  136. --Now the module encodes your data and sends to the server.
  137.  
  138. --Returns a table with "status" and "info"
  139.  
  140. print("Status: " , saveData["status"]);
  141.  
  142. print("Info: ", saveData["info"]);
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151. --[[-- Getting data --]]--
  152.  
  153. local devAPI = require(993003470);
  154.  
  155. local username = "xxxxxx";
  156. local password = "xxxxxxxxxxxxxx";
  157.  
  158.  
  159.  
  160. local fetchData = devAPI:GetAsync(username, password);
  161.  
  162. --Returns atable with "status", "info" and "data"
  163.  
  164. print("Status: ", fetchData["status"])
  165.  
  166.  
  167.  
  168. if (fetchData["status"] == "success") then
  169.  
  170.  
  171.     print("Data : ", fetchData["data"])
  172.  
  173.     local data = fetchData["data"]
  174.  
  175.     print(data.PRICE)
  176.     --Continue here
  177.    
  178.  
  179.  
  180.     elseif fetchData["status"] == "error" then
  181.  
  182.     print("Info : ", fetchData["info"])
  183.  
  184.  
  185.  
  186. end
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193. --[[-- Getting group information --]]--
  194.  
  195. local devAPI = require(993003470);
  196.  
  197. local username = "xxxxxx";
  198. local password = "xxxxxxxxxxxxxx";
  199.  
  200.  
  201. local groupInfo = devAPI:GroupInfo("2", true, "Name") --Requires 1 argument. 2 optional 1)  Return the table with or without decoding it | 2) Name of what they want to return (i.e "Name" will return the group name) . Example: GroupInfo(id, true, "Name")
  202.  
  203. print(groupInfo)
  204.  
  205. --> LOL
  206.  
  207.  
  208.  
  209. --[[-- Checking if two users are friends --]]--
  210.  
  211. local devAPI = require(993003470);
  212.  
  213. local username = "xxxxxx";
  214. local password = "xxxxxxxxxxxxxx";
  215.  
  216. local isFriends = devAPI:IsFriends("1", "1") -- Requires 2 arguments, the user id of the 2 users as string.
  217.  
  218. print(isFriends)
  219.  
  220.  
  221. --> TRUE
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228. --[[-- Getting the name from the user id --]]--
  229.  
  230. local devAPI = require(993003470);
  231.  
  232. local username = "xxxxxx";
  233. local password = "xxxxxxxxxxxxxx";
  234.  
  235.  
  236.  
  237. local userName = devAPI:GetNameFromID("18442032", true); --Requires 1 argument. 1 optional 1) If you want it to just print the username instead of a table
  238.  
  239. print(userName)
  240.  
  241. --> Kekulator
  242.  
  243.  
  244.  
  245. --[[-- Getting the id from the username --]]
  246.  
  247. local devAPI = require(993003470);
  248.  
  249. local username = "xxxxxx";
  250. local password = "xxxxxxxxxxxxxx";
  251.  
  252. local userID = devAPI:GetIDFromName("Kekulator", true) -- Requires 1 argument. 1 optional 1) If you want it to just print the username instead of a table
  253.  
  254. print(userID)
  255.  
  256. --> 18442032
Add Comment
Please, Sign In to add comment