BLUSHIF

Untitled

Jan 1st, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. /*this is just the part that sends the request, the rest is unnecesary*/
  2. var ro=true;
  3. function sendData() {
  4. if(ep[0]!=null&&sp[0]!=null&&ro){
  5. var data = {
  6. "strt":sp,
  7. "end":ep,
  8. "blk":blocks,
  9. "sblk":sblocks,
  10. "enem":enemies,
  11. "slft":spikesl,
  12. "srt":spikesr,
  13. "su":spikesu,
  14. "sd":spikesd
  15. };
  16. var payload = JSON.stringify(data);
  17. var XHR = new XMLHttpRequest();
  18. XHR.addEventListener('load', handledt);
  19. XHR.open("POST", "submit.php");
  20. XHR.setRequestHeader('Content-Type', 'application/json');
  21. XHR.send(payload);
  22. } else {
  23. alert("please set player and end portal position");
  24. }
  25. ro=false;
  26. }
  27. function handledt() {if(this.responseText=="s")location.reload();}
Advertisement
Add Comment
Please, Sign In to add comment