Let me explain my idea. I've created a GUI with a black background that it's set to 100 transparency, and when 5 minutes have passed, the transparency changes to 90, 80, 70 all the way to 50, where it returns to 60, 70, 80 all the way to 100 again, being 50 the darkest the gui will get (midnight). All this using global ints and the SetTimer function. The global int it's on 1 and the GUI is on, and the GUI it's set to not be clickeable.
Here's the code. If anyone can help me, please, do it.
Code: Select all
function repeatedly_execute() {
if (GetGlobalInt(13)==1) {
SetGUITransparency(6, 100);
SetTimer(1, 12000);
SetGlobalInt(13, 2);
}
else if (GetGlobalInt(13)==2) {
if (IsTimerExpired(1)==1) {
SetGUITransparency(6, 90);
SetTimer(2, 12000);
SetGlobalInt(13, 3);
}
}
else if (GetGlobalInt(13)==3) {
if (IsTimerExpired(2)==1) {
SetGUITransparency(6, 80);
SetTimer(3, 12000);
SetGlobalInt(13, 4);
}
}
else if (GetGlobalInt(13)==4) {
if (IsTimerExpired(3)==1) {
SetGUITransparency(6, 70);
SetTimer(4, 12000);
SetGlobalInt(13, 5);
}
}
else if (GetGlobalInt(13)==5) {
if (IsTimerExpired(4)==1) {
SetGUITransparency(6, 60);
SetTimer(5, 12000);
SetGlobalInt(13, 6);
}
}
else if (GetGlobalInt(13)==6) {
if (IsTimerExpired(5)==1) {
SetGUITransparency(6, 50);
SetTimer(6, 12000);
SetGlobalInt(13, 7);
}
}
else if (GetGlobalInt(13)==7) {
if (IsTimerExpired(6)==1) {
SetGUITransparency(6, 60);
SetTimer(7, 12000);
SetGlobalInt(13, 8);
}
}
else if (GetGlobalInt(13)==8) {
if (IsTimerExpired(7)==1) {
SetGUITransparency(6, 70);
SetTimer(8, 12000);
SetGlobalInt(13, 9);
}
}
else if (GetGlobalInt(13)==9) {
if (IsTimerExpired(8)==1) {
SetGUITransparency(6, 80);
SetTimer(9, 12000);
SetGlobalInt(13, 10);
}
}
else if (GetGlobalInt(13)==10) {
if (IsTimerExpired(9)==1) {
SetGUITransparency(6, 90);
SetTimer(10, 12000);
SetGlobalInt(13, 1);
}
}
}