{ "name" : "Value to Label", "attributes": [ { "name": "Value", "type": "Number", "connection": "Input", "editable": true }, { "name": "Label Type", "type": "Dropdown", "value": { "default": "Entity", "options": { "UI": "UI", "Entity": "Entity" } }, "connection": "None", "editable": true }, { "name": "Label Name", "type": "Text", "value": "Label", "connection": "None", "editable": true } ], "script": "//by Smart Penguins https://www.youtube.com/channel/UCHDFEsDQ8dKjEBEVCbAPZZw/ let label; let lType; let lName; function init(){ lType = this.attribute('Label Type'); lName = this.attribute('Label Name'); } function start(){ if(lType=='Entity'){ label=this.entity().component(lName); } } function update(dt){ } function signal(name, value, sender){ if(lType=='UI'){ label=this.ui().find(lName)[0]; } if(label!=null&&label.setText!=null){ label.setText(String(value)); } } function requested(name, arg, sender){ return this; } " }