Carpet

Carpet

2M Downloads

__on_tick() seems to be too fast sometimes.

poombus opened this issue ยท 3 comments

commented

I don't know how to replicate this, all I know is that it usually happens when there are multiple players on the server (real and fake).

Say I have a scoreboard objective that increases by 1 every second.

__on_tick() -> (
    scoreboard('ticks','val',scoreboard('ticks','val')+1);
    if(scoreboard('ticks','val')%20==0,
       scoreboard('seconds','val', scoreboard('seconds','val')+1);
    );
);

However, having players on the server seems to speed up how fast scoreboard('seconds','val') increases (faster than a second). The more players there are, the faster it counts up.

commented

Is the app on player scope? If so, __on_tick gets executed once per tick per player.

commented

As in running /script load SCRIPT global? I thought that might've been it, but it still counts too fast.

Or am I misunderstanding how to change the scope of the app.

commented

Ah, I looked at the docs a bit more closely.

I see you need to change the scope in __config().

I thought you changed it by adding/omitting "global" when running the /script load command lmao.

Thanks for that @James103.