Using setTick to draw marker in JavaScript

I am having few issues with setTick. I have used this method but Fivem crashes when the script loads.

This is what I have for now:

Delay = (ms) => new Promise(res => setTimeout(res, ms));

setTick(async () => {
    await Delay(1000);
    while(true){
        DrawMarker(114.23404693603516, -1408.731201171875, 30.41048240661621, 0.0, 0.0, 0.0, 0.0, 180.0, 0.0, 2.0, 2.0, 2.0, 255, 128, 0, 50, false, true, 2, null, null, false)
    }
})

Thanks for the help in advance!

If you’re using setTick, you don’t have to wait or do a while loop.

The problem was with my DrawMarker. I replaced it with this:

DrawMarker(20, 114.23404693603516, -1408.731201171875, 30.41048240661621, 0, 0, 0, 0, 0, 0, 1.001, 1.0001, 0.5001, 169, 169, 169, 200, false, 0, 0, 0) 

It works now, thank you :smiley: