Dolphin86 Posted October 9, 2023 Group: Members Topic Count: 280 Topics Per Day: 0.06 Content Count: 757 Reputation: 17 Joined: 01/07/12 Last Seen: April 27 Share Posted October 9, 2023 as title, when i click on my npc at 1st time it was working as it should, but when i click it on the 2nd time i got this delay Spoiler script: Spoiler neko_isle,71,122,6 script Green Tree 659,{ if(Pick == 1) goto Pick1; if(Pick == 2) goto Pick2; if(Pick == 3) goto Pick3; else { getitem 512, 1; set Pick,1; close; } Pick1: if (gettimetick(2) > #COOLDOWN_PICK) { #COOLDOWN_PICK += (gettimetick(2) + 3); // 3 seconds. getitem 512, 1; set Pick,2; } Pick2: if (gettimetick(2) > #COOLDOWN_PICK) { #COOLDOWN_PICK += (gettimetick(2) + 3); // 3 seconds. getitem 512, 1; set Pick,3; } Pick3: if (gettimetick(2) > #COOLDOWN_PICK) { #COOLDOWN_PICK += (gettimetick(2) + 3); // 3 seconds. getitem 512, 1; set Pick,0; } mes "Need to wait "+(#COOLDOWN_PICK - gettimetick(2))+" seconds."; close; } also i plan to make duplicate of this which each npc will give different items Quote Link to comment Share on other sites More sharing options...
0 Forshaken Posted October 9, 2023 Group: Members Topic Count: 15 Topics Per Day: 0.01 Content Count: 152 Reputation: 21 Joined: 11/12/18 Last Seen: Thursday at 12:21 PM Share Posted October 9, 2023 t 4 hours ago, Dolphin86 said: as title, when i click on my npc at 1st time it was working as it should, but when i click it on the 2nd time i got this delay Hide contents script: Hide contents neko_isle,71,122,6 script Green Tree 659,{ if(Pick == 1) goto Pick1; if(Pick == 2) goto Pick2; if(Pick == 3) goto Pick3; else { getitem 512, 1; set Pick,1; close; } Pick1: if (gettimetick(2) > #COOLDOWN_PICK) { #COOLDOWN_PICK += (gettimetick(2) + 3); // 3 seconds. getitem 512, 1; set Pick,2; } Pick2: if (gettimetick(2) > #COOLDOWN_PICK) { #COOLDOWN_PICK += (gettimetick(2) + 3); // 3 seconds. getitem 512, 1; set Pick,3; } Pick3: if (gettimetick(2) > #COOLDOWN_PICK) { #COOLDOWN_PICK += (gettimetick(2) + 3); // 3 seconds. getitem 512, 1; set Pick,0; } mes "Need to wait "+(#COOLDOWN_PICK - gettimetick(2))+" seconds."; close; } also i plan to make duplicate of this which each npc will give different items try to put end; function on each Pick# function Quote Link to comment Share on other sites More sharing options...
0 Dolphin86 Posted October 9, 2023 Group: Members Topic Count: 280 Topics Per Day: 0.06 Content Count: 757 Reputation: 17 Joined: 01/07/12 Last Seen: April 27 Author Share Posted October 9, 2023 3 hours ago, Forshaken said: t try to put end; function on each Pick# function nope that did not work Quote Link to comment Share on other sites More sharing options...
0 Dolphin86 Posted October 9, 2023 Group: Members Topic Count: 280 Topics Per Day: 0.06 Content Count: 757 Reputation: 17 Joined: 01/07/12 Last Seen: April 27 Author Share Posted October 9, 2023 (edited) as title i was trying to enable player to talk to the npc only 3 times, on between those 3x talk there is 5 seconds gap where player will have to wait, now after the player talked to the npc 3x, he/she will need to wait 3 minutes until he /she can talk again with the npc, but i got confused to to set player from the 1st 5 sec wait to the 3 minute wait.. kindly guide me.. Script: neko_isle,71,122,6 script Green Tree 659,{ if(Pick == 0) goto Pick1; if(Pick == 1) goto Pick2; if(Pick == 2) goto Pick3; if(Pick == 3) goto Pick4; if(Pick == 4) goto Pick5; Pick1: if(#tree1_CD > gettimetick(2)) {mes "Please wait for 5 seconds. "; end;} getitem 512, 1; set Pick,1; set #tree1_CD,gettimetick(2) + 5; end; Pick2: if(#tree1_CD > gettimetick(2)) {mes "Please wait for 5 seconds. "; end;} getitem 512, 1; set Pick,2; set #tree1_CD,gettimetick(2) + 5; end; Pick3: if(#tree1_CD > gettimetick(2)) {mes "Please wait for 5 seconds. "; end;} getitem 512, 1; set Pick,3; set #tree1_CD,gettimetick(2) + 5; end; Pick4: if(#tree1_CD > gettimetick(2)) {mes "Please wait for 5 seconds. "; end;} getitem 512, 1; set Pick,4; set #tree1load1_CD,gettimetick(2) + 20; end; Pick5: if(#tree1load1_CD > gettimetick(2)) {mes "Empty, come back again in 3 minute. "; end;} getitem 512, 1; set Pick,0; set #tree1_CD,gettimetick(2) + 5; end; } the script had been changed totally from ground up, fixed the delay issue but came up with new problem by changing the timer / quest on players Nvm it works as it should, i did not notice the timer i edited with extra minutes... Edited October 9, 2023 by Dolphin86 Quote Link to comment Share on other sites More sharing options...
Question
Dolphin86
as title, when i click on my npc at 1st time it was working as it should, but when i click it on the 2nd time i got this delay
script:
neko_isle,71,122,6 script Green Tree 659,{ if(Pick == 1) goto Pick1; if(Pick == 2) goto Pick2; if(Pick == 3) goto Pick3; else { getitem 512, 1; set Pick,1; close; } Pick1: if (gettimetick(2) > #COOLDOWN_PICK) { #COOLDOWN_PICK += (gettimetick(2) + 3); // 3 seconds. getitem 512, 1; set Pick,2; } Pick2: if (gettimetick(2) > #COOLDOWN_PICK) { #COOLDOWN_PICK += (gettimetick(2) + 3); // 3 seconds. getitem 512, 1; set Pick,3; } Pick3: if (gettimetick(2) > #COOLDOWN_PICK) { #COOLDOWN_PICK += (gettimetick(2) + 3); // 3 seconds. getitem 512, 1; set Pick,0; } mes "Need to wait "+(#COOLDOWN_PICK - gettimetick(2))+" seconds."; close; }
also i plan to make duplicate of this which each npc will give different items
Link to comment
Share on other sites
3 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.