btw this is c# im talking about.



if p1ammo = 1 then
do stuff
end if
volatile bool isRunning = true;
Thread t;
void StartWriting()
{
isRunning = true;
t = new Thread(() =>
{
while(isRunning)
{
// Write to memory here
Thread.Sleep(1000); // Sleep thread for 1 second (1000 milliseconds)
}
});
t.Start();
}
void StopWriting()
{
isRunning = false;
t.Join();
}