Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. //To test, just add the script and the sheet to any blank game, then create a new blank Character in the game, then do any chat message.
  2. //Expected behavior:
  3. // "Found webworker script"
  4. // "API Ready."
  5. // "Hello from sheetworker"
  6. // "Creating baseattribute..."
  7. // "Base attribute heard change"
  8. // "Created attribute heard change"
  9.  
  10. on("chat:message", function() {
  11. //Find the first character and just use it
  12. var firstChar = findObjs({type: "character"})[0];
  13. if(!firstChar) {
  14. log("You must make a character manually");
  15. return;
  16. }
  17. log("Creating baseattribute...");
  18. var newattrib = createObj("attribute", {characterid: firstChar.id, name: "baseattribute"});
  19. newattrib.setWithWorker({
  20. current: "1"
  21. });
  22. });
  23.  
  24. on("ready", function() {
  25. log("API Ready.");
  26. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement