Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   I'm not the best at scripting, so... (https://forums.graalonline.com/forums/showthread.php?t=20480)

Psyker 01-06-2002 06:00 AM

I'm not the best at scripting, so...
 
Is there any possible way to make this script better?

NPC Code:
if (playerenters){
showlocal;
message Status;
}
if (playertouchsme) {
toweapons *Status;
hidelocal;
}
if (weaponfired) {
say2 If you want to check what you #bare using, say 'check head',#b'check sword', or 'check shield'.;
}
if (playerchats&&strequals(#c,check sword)) {
say2 The sword you are using is:#b#1;
}
if (playerchats&&strequals(#c,check head)) {
say2 The head you are using is:#b#3;
}
if (playerchats&&strequals(#c,check shield)) {
say2 The shield you are using is:#b#2;
}


mikepg 01-06-2002 06:10 AM

...
 
the only way i can see to fix it, would be to use nested ifs for playerchats and change the players chat so say2 doenst loop

NPC Code:

if (playerenters){
showlocal;
message Status;
}
if (playertouchsme) {
toweapons *Status;
hidelocal;
}
if (weaponfired) {
say2 If you want to check what you #bare using, say 'check head',#b'check sword', or 'check shield'.;
}
if (playerchats) {
if (strequals(#c,check sword)) {
say2 The sword you are using is:#b#1;
setplayerprop #c,;
}
if (strequals(#c,check head)) {
say2 The head you are using is:#b#3;
setplayerprop #c,;
}
if (strequals(#c,check shield)) {
say2 The shield you are using is:#b#2;
setplayerprop #c,;
}
}



other than that, its fine.

Psyker 01-06-2002 12:32 PM

Thanks a lot! :)


All times are GMT +2. The time now is 03:41 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.