Hello everyone, I'm trying to make a script for a NPC to change the player's rates with SC_EXPBOOST and SC_ITEMBOOST. I'm new to scripting and there might be a better way to make what I want but it works and I'm happy that I was able to make it work.
I've got a menu working
mes "[Rate Professor]";
mes "You can change the rate you are using.";
mes "Your current rate is ^777777"+rate$+"/"+rate$+"/"+drop$+"^000000";
mes "Please select the rate you want:";
// --------------------------------------------------
// Main Menu:
// --------------------------------------------------
menu "Change Exp Rates",EXPMenu,
"Change Drop Rate",DROPMenu,
"Cancel",Cancel;
// --------------------------------------------------
EXPMenu:
// --------------------------------------------------
menu " 1x/1x EXP",e1x,
" 2x/2x EXP",e2x;
// --------------------------------------------------
DROPMenu:
// --------------------------------------------------
menu " 1x DROP",d1x,
" 2x DROP",d2x;
The Change Exp Rates works with those lines :
e1x: sc_end SC_EXPBOOST; set rate$ , "1x";end;
e2x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,100; set rate$ , "2x";end;
If the player select 1x, the script will remove the SC_EXPBOOST and set the variable rate$ to x1, which is shown in the NPC's message. I've got it working till 20x and I don't have any problem changing rates, removing the buff, login out/login in.
But whenever I try to change the drop rate with :
d1x: sc_end SC_ITEMBOOST; set drop$ , "1x";end;
d2x: sc_end SC_ITEMBOOST; sc_start SC_ITEMBOOST,-1,100; set drop$ , "2x";end;
I get an error:
[Error]: npc_parsesrcfile: Unknown syntax in file 'npc/custom/Rate Changer.txt', line '101'. Stopping...
* w1=d1x: sc_end SC_ITEMBOOST; set drop$ , "1x";end;
* w2=
* w3=
* w4=
When the "d1x" line (or any other line like those) are included in the script, the NPC is not spawn in the world. When I comment them out, the NPC spawn without any issue. I try to find a way to make it work but I couldn't and I don't really understand the error message. Never got that error when I was writing the EXP part. Something else that I try was to put the effect from the bubble gum item (ID:12210 = sc_start SC_ITEMBOOST,1800000,200;) in the script but I still got the same error but with the bubble gum script.
If someone could tell me where the error is or what I'm doing wrong it would be greatly appreciated.
Question
exyoupjkbrxd
Hello everyone, I'm trying to make a script for a NPC to change the player's rates with SC_EXPBOOST and SC_ITEMBOOST. I'm new to scripting and there might be a better way to make what I want but it works and I'm happy that I was able to make it work.
I've got a menu working
mes "[Rate Professor]"; mes "You can change the rate you are using."; mes "Your current rate is ^777777"+rate$+"/"+rate$+"/"+drop$+"^000000"; mes "Please select the rate you want:"; // -------------------------------------------------- // Main Menu: // -------------------------------------------------- menu "Change Exp Rates",EXPMenu, "Change Drop Rate",DROPMenu, "Cancel",Cancel; // -------------------------------------------------- EXPMenu: // -------------------------------------------------- menu " 1x/1x EXP",e1x, " 2x/2x EXP",e2x; // -------------------------------------------------- DROPMenu: // -------------------------------------------------- menu " 1x DROP",d1x, " 2x DROP",d2x;
The Change Exp Rates works with those lines :
e1x: sc_end SC_EXPBOOST; set rate$ , "1x";end; e2x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,100; set rate$ , "2x";end;
If the player select 1x, the script will remove the SC_EXPBOOST and set the variable rate$ to x1, which is shown in the NPC's message. I've got it working till 20x and I don't have any problem changing rates, removing the buff, login out/login in.
But whenever I try to change the drop rate with :
d1x: sc_end SC_ITEMBOOST; set drop$ , "1x";end; d2x: sc_end SC_ITEMBOOST; sc_start SC_ITEMBOOST,-1,100; set drop$ , "2x";end;
I get an error:
[Error]: npc_parsesrcfile: Unknown syntax in file 'npc/custom/Rate Changer.txt', line '101'. Stopping... * w1=d1x: sc_end SC_ITEMBOOST; set drop$ , "1x";end; * w2= * w3= * w4=
When the "d1x" line (or any other line like those) are included in the script, the NPC is not spawn in the world. When I comment them out, the NPC spawn without any issue. I try to find a way to make it work but I couldn't and I don't really understand the error message. Never got that error when I was writing the EXP part. Something else that I try was to put the effect from the bubble gum item (ID:12210 = sc_start SC_ITEMBOOST,1800000,200;) in the script but I still got the same error but with the bubble gum script.
If someone could tell me where the error is or what I'm doing wrong it would be greatly appreciated.
Thank you
Link to comment
Share on other sites
2 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.