Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. Like the title says, sorry for another PM from me, must get annoying. I did ask Daniel to have you look at the thread in question (mentioned below) over msn, but I guess he didn't.
  2.  
  3. Anyways, I've waited for you to respond to my posts about your script in the NPC help! thread for quite awhile, you even posted the same script (modified to fix the guys .bat error I'm sure) with the errors I mentioned. You've been using functions wrong :/
  4. This is an excerpt from memory of your script in function action.
  5. PHP Code:
  6. if(selection == 3) {
  7. nxTrader(selection);
  8. } else {
  9. trader(selection);
  10. }
  11. Can you see where there's an issue with this? The NPC returns to function action every time you hit a button, it doesn't stay in the function you sent it to sadly. You need to set up booleans (I recommend associative arrays for larger scripts with more functions) to define which function is in play. I would have done it like this.
  12. PHP Code:
  13. var nxTrader = false, trader = false;
  14. // or var whichFunction = {"nxTrader" : false, "trader" : false};
  15.  
  16. if(!nxTrader && !trader) {
  17. if(selection == 3) {
  18. nxTrader = true;
  19. } else {
  20. trader = true;
  21. }
  22. }
  23. // OR
  24. //if(!whichFunction["nxTrader"] && !whichFunction["trader"]) {
  25. //whichFunction[selection == 3 ? "nxTrader" : "trader"] = true;
  26. //}
  27. //if(whichFunction["nxTrader"]) {
  28. //chixNX(selection);
  29. //} else if (whichFunction["trader"]) {
  30. //trader(selection);
  31. }
  32. if(nxTrader) {
  33. //if(whichFunction["nxTrader"]) {
  34. chixNX(selection); // yes, you named it chixNX in your script even though you originally called it as nxTrader(selection)
  35. } else if (trader) {
  36. //} else if (whichFunction["trader"]) {
  37. trader(selection);
  38. }
  39. This way ^^^, when the NPC returns to function action, it knows exactly where to go.
  40.  
  41. I used to idolize your scripting (not that I think any less of it now, I started learning by reading your scripts and guides), so it brings me down when I see you posting scripts like that :/ And I get that you're probably busy and don't really have time to look at threads or make sure your scripting is perfect, so I appreciate you taking the time to read this.
  42.  
  43. I'll stop buggin you now, I'm sure you've had enough XD
  44.  
  45. ~ Chris
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement