Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //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.
- //Expected behavior:
- // "Found webworker script"
- // "API Ready."
- // "Hello from sheetworker"
- // "Creating baseattribute..."
- // "Base attribute heard change"
- // "Created attribute heard change"
- on("chat:message", function() {
- //Find the first character and just use it
- var firstChar = findObjs({type: "character"})[0];
- if(!firstChar) {
- log("You must make a character manually");
- return;
- }
- log("Creating baseattribute...");
- var newattrib = createObj("attribute", {characterid: firstChar.id, name: "baseattribute"});
- newattrib.setWithWorker({
- current: "1"
- });
- });
- on("ready", function() {
- log("API Ready.");
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement