PLK_StorageSyncGoogle
A downloadable tool
Buy Now$3.00 USD or more
* Terms of Use * No duplication or distribution is permitted. Can be used in commercial games I ask you to specify "Palatkorn" in your game credits only
This plugin requires this plugin to be loaded first.
https://palatkorn.itch.io/plk-storage
I have upgraded my inventory using google sheets
to a real-time database. This will be a fun way to give away items to our game players.
Steps to create your own database
1. Copy this code and keep it for yourself.
Create a database according to this topic. Do not change it.
2.Open Extensions
3.Select Apps Script
4.Copy the code below and replace YOUR_SPREADSHEET_ID with yours.
![](https://img.itch.zone/aW1nLzE5NzcxMjI0LnBuZw==/original/rtPkA8.png)
function doGet(e) {
var ss = SpreadsheetApp.openById("YOUR_SPREADSHEET_ID");
var sheet = ss.getSheetByName("DATA");
var data = sheet.getDataRange().getValues();
var headers = data.shift();
var jsonArray = [];
data.forEach(function(row) {
var obj = {};
row.forEach(function(cell, i) {
obj[headers[i]] = cell;
});
jsonArray.push(obj);
});
var result = JSON.stringify(jsonArray);
return ContentService
.createTextOutput(result)
.setMimeType(ContentService.MimeType.JSON);
}
5.Press the Deploy button and select New deployment.
6.Press the gear button, select Web app At the bottom, select Anyone
The final step is to insert the obtained URL into the plugin.
Run the command plugin command in the game.
Advice: You should set the Receive with a Time variable so that players can receive your giveaways at the game's time, and then reset it back to 0. Here is an example.
Purchase
Buy Now$3.00 USD or more
In order to download this tool you must purchase it at or above the minimum price of $3 USD. You will get access to the following files:
PLK_StorageSyncGoogle.js 82 kB
Leave a comment
Log in with itch.io to leave a comment.