AinsLord Posted May 6, 2021 Group: Members Topic Count: 261 Topics Per Day: 0.08 Content Count: 758 Reputation: 20 Joined: 11/21/15 Last Seen: April 6 Share Posted May 6, 2021 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 Quote Link to comment Share on other sites More sharing options...
0 Mastagoon Posted May 6, 2021 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 63 Reputation: 38 Joined: 07/04/19 Last Seen: December 14, 2024 Share Posted May 6, 2021 (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 May 6, 2021 by Mastagoon Quote Link to comment Share on other sites More sharing options...
0 AinsLord Posted May 6, 2021 Group: Members Topic Count: 261 Topics Per Day: 0.08 Content Count: 758 Reputation: 20 Joined: 11/21/15 Last Seen: April 6 Author Share Posted May 6, 2021 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 Quote Link to comment Share on other sites More sharing options...
0 Mastagoon Posted May 7, 2021 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 63 Reputation: 38 Joined: 07/04/19 Last Seen: December 14, 2024 Share Posted May 7, 2021 7 hours ago, AinsLord said: got tested i have this error on my console There is a typo in this code change gettimetic(2) to gettimetick(2) . Quote Link to comment Share on other sites More sharing options...
0 AinsLord Posted May 7, 2021 Group: Members Topic Count: 261 Topics Per Day: 0.08 Content Count: 758 Reputation: 20 Joined: 11/21/15 Last Seen: April 6 Author Share Posted May 7, 2021 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 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; } Quote Link to comment Share on other sites More sharing options...
0 Mastagoon Posted May 7, 2021 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 63 Reputation: 38 Joined: 07/04/19 Last Seen: December 14, 2024 Share Posted May 7, 2021 1 hour ago, AinsLord said: i tried but i got this error 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; } 1 Quote Link to comment Share on other sites More sharing options...
Question
AinsLord
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
thanks in advance
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.