Jump to content
  • 0

putting delay after use on bind command


Question

Posted

so i was trying to put like 5 secs delay on binded command i dunno if im doing it right seems got errors

any one can help

this is the script

-	script	maintown	-1,{
OnInit:
	bindatcmd "maintown",strnpcinfo(3)+"::OnAtcommand";
	end;


OnCommand:

    if(gettimetic(2) < cooldowntime ){
        dispbottom "Please wait 5 seconds!";
        end;
    }
    atcommand "@maintown";
    set cooldowntime,gettimetic(2)+5;

    end;

OnAtcommand:
	atcommand "@warp alexandria 158 144";
	end;
}

thanks in advance

5 answers to this question

Recommended Posts

  • 0
Posted
1 hour ago, AinsLord said:

i tried but i got this error

image.png.9373877ce95121e451e870b3b19f5ffe.png

Sorry for the delay, here's the correct code:

-	script	maintown	-1,{
OnInit:
	bindatcmd "maintown",strnpcinfo(3)+"::OnAtcommand";
	end;

OnAtcommand:
    if(gettimetick(2) < cooldowntime) {
        dispbottom "Please wait "+(cooldowntime - gettimetick(2))+" seconds.";
    	end;
    }
	atcommand "@warp prontera 158 144";
    set cooldowntime, gettimetick(2) + 5;
	end;
}

image.png.e029abba52199f14141b6c3b75e5d3e6.png

  • Upvote 1
  • 0
Posted (edited)

Untested

-	script	maintown	-1,{
OnInit:
	bindatcmd "maintown",strnpcinfo(3)+"::OnAtcommand";
	end;

OnAtcommand:
        if(gettimetic(2) < cooldowntime) {
              dispbottom "Please wait "+(cooldowntime - gettimetic(2)) / 1000+" seconds.";
              end;
        }
	atcommand "@warp alexandria 158 144";
    set cooldowntime, 5000;
	end;
}

 

Edited by Mastagoon
  • 0
Posted
1 minute ago, Mastagoon said:

Untested


-	script	maintown	-1,{
OnInit:
	bindatcmd "maintown",strnpcinfo(3)+"::OnAtcommand";
	end;

OnAtcommand:
        if(gettimetic(2) < cooldowntime) {
              dispbottom "Please wait "+cooldowntime - gettimetic(2) / 1000)+" seconds.";
              end;
        }
	atcommand "@warp alexandria 158 144";
	end;
}

 

got tested i have this error on my console

image.png.b0b1d24ae966c7960b515fc09c61e9b5.png

  • 0
Posted
7 hours ago, AinsLord said:

got tested i have this error on my console

image.png.b0b1d24ae966c7960b515fc09c61e9b5.png

There is a typo in this code

change gettimetic(2) to gettimetick(2) .

  • 0
Posted
On 5/7/2021 at 9:40 AM, Mastagoon said:

There is a typo in this code

change gettimetic(2) to gettimetick(2) .

i tried but i got this error

image.png.9373877ce95121e451e870b3b19f5ffe.png

 

thanks a lot man this would really help ❤️

On 5/7/2021 at 9:06 PM, Mastagoon said:

Sorry for the delay, here's the correct code:

-	script	maintown	-1,{
OnInit:
	bindatcmd "maintown",strnpcinfo(3)+"::OnAtcommand";
	end;

OnAtcommand:
    if(gettimetick(2) < cooldowntime) {
        dispbottom "Please wait "+(cooldowntime - gettimetick(2))+" seconds.";
    	end;
    }
	atcommand "@warp prontera 158 144";
    set cooldowntime, gettimetick(2) + 5;
	end;
}

image.png.e029abba52199f14141b6c3b75e5d3e6.png

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...