Hi, I´ve put an event (hat) block in a sprite extension, but never runs. Even if I code this:
OnRun
(args, app, device, block) => {
// TODO
console.log(“run”);
return true;
}
I appreciate your help. Thanks, regards.
Hi, I´ve put an event (hat) block in a sprite extension, but never runs. Even if I code this:
OnRun
(args, app, device, block) => {
// TODO
console.log(“run”);
return true;
}
I appreciate your help. Thanks, regards.
Consider using a JavaScript Function, @astoctas:
https://www.w3schools.com/js/js_functions.asp
Put your function definition in the “Common code settings” section of the extension builder:
That works for me.
@Best_codes. I want to execute blocks under this one if a condition is true, like documentation
So does “When click in green flag”
@Best_codes I guess that an event block is just like a “forever and if” but how can I code this in an extension?
I’m working on an extension that does that. When I’m done, I’ll take some screenshots and send them to you. @astoctas