Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
807 B
2
Indexable
Never
// Function for sending messages to a public channel with a limit on sending speed (<200/10sec). 2023.12.14; by Paradox
integer MessagesCounter;
float MessagesTimerTime1;
float MessagesTimerTime2;
SaySpeedLimit(integer channel, string  message)
{
        //1 message start time
        if (MessagesCounter == 0)
        {
            MessagesTimerTime1 = llGetTime();
            MessagesCounter = 1;
        }
        
        // Saying
        llSay(channel, message);
        
        //2 message end time
        if (MessagesCounter == 1)
        {
            MessagesTimerTime2 = llGetTime();
            MessagesCounter = 0;
        }
        
        //Pause
        if (MessagesTimerTime2 - MessagesTimerTime1 <= 0.1)
        {
            llSleep(0.1); 
        }    
}
Leave a Comment