Load a tablet app script when enter on a domain


#1

I’ve found a way to automatically load a tablet app script when an user enter on a domain
. (thank you HumbleTim & Aitolda !!!)

1.Create a big hidden collision-less box that overlaps the position where the avatars enter on the domain.
2. Create a script like this:

(function(){

    var TabletItem = function(){

    };

   TabletItem.prototype = {

        preload: function(entityID) {
            Script.require('./tabletscript.js');
        }

    };
    return new Tablettem();

});

where tabletscript.js is your tablet script.

  1. Save the script as loadtabletapp.js, and host it in the same folder with your tabletscript.js on an accessible web location (ex: http://example.com)
  2. Put the script location in Script URL of the previously created box (ex: http://example.com/loadtabletapp.js)

When an user enter in your domain will enter on the box and execute the loadtabletapp.js which will launch the tablet app script.

Happy coding!


#2

Heya!

Yep, that works. You can also directly link the tablet app itself as an entity script. That’s how the support app works in Help.


#3

And that does not work if you did upload the script to your domain ?