Hi Chinx7
My guess is that, sometimes, your variable $playandtime doesn't contain any separator ":"
Then the Array $playandtimeA is recreated with a single element [0], here :
$playandtimeA = StringSplit ($playandtime,":",2)
That's why you never get an error with $GlobalTimestamp = $playandtimeA[0]
But the error arrives immediately after with $GlobalPlaystate = $playandtimeA[1]
I suggest you add a test to detect that $playandtime contains a ":" each time the function is called, for example :
$playandtime = TCPRecv ($SocketServer,2048)
If StringInStr($playandtime, ":") = 0 Then
MsgBox(0, "Error", "Separator : not found in string $playandtime")
EndIf
You'll tell us