[SOLVED] Timer code with something activate

Explanation:
I’m trying to make a timer code that when it count to zero then “something” will activate it for example, you have 30 sec to prepare up then when its 0 sec. The door will open it…

Can anyone help me with it? I did tried compare 1.0 script to 2.0… still can;t figure it out ~

if (this.status==="hidden") {
                this.shadowtiming+=dt;
                if (this.shadowtiming>this.shadows*20) {
                    this.status="";
                    this.model.model.model.meshInstances[0].material.setParameter('material_opacity', 1);
                    this.model.model.model.meshInstances[1].material.setParameter('material_opacity', 1);
                    this.Root.script.Output.write(this.dataWarnings[0].leavesh);
                    this.shadowtiming=0;
                }
                //app.root.findByName('Root').script.Output.write(this.shadowtiming);
            }

this is a code that change the opacity of a material back to visible (1) after this.shadowtiming time is passed i guess this can help you to understand. you have to put it inside update: function

1 Like

Thanks m8! This is just what i need :3

what is the starting value of shadows here?

this.shadows it’s 1 but can be any value in my case it’s from 1 to 10

Okay, so it executes after at least 20 seconds. Thanks for clarifying.

1 Like