Skip to content

Instantly share code, notes, and snippets.

@Atlante45
Created January 31, 2019 01:26
Show Gist options
  • Save Atlante45/2573e5d65dc2e81960a2635952a65691 to your computer and use it in GitHub Desktop.
Save Atlante45/2573e5d65dc2e81960a2635952a65691 to your computer and use it in GitHub Desktop.
var entitiesWithServerScripts = 0
var interval = Script.setInterval(function() {
console.log("Checks pending:", entitiesWithServerScripts)
var entities = Entities.findEntities(Vec3.ZERO, 100000);
for (var i in entities) {
var entity = entities[i];
var props = Entities.getEntityProperties(entity, ["serverScripts"]);
if (props.serverScripts != "") {
Entities.getServerScriptStatus(entity, (function() {
var entityID = entity;
var serverScripts = props.serverScripts;
return function(success, isRunning, status, errorInfo) {
if (!success || !isRunning) {
console.log("Script not running:", entityID, success, isRunning, status, errorInfo, JSON.stringify(serverScripts));
}
entitiesWithServerScripts--
}
})());
entitiesWithServerScripts++
}
}
console.log("Num entities to check:", entitiesWithServerScripts)
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment