Nuntar
Level: Smitemaster
Rank Points: 4596
Registered: 02-20-2007
IP: Logged
|
Re: Accessory Help Needed! (+2)
Remove "Go to 2" and "Label 2", and while you're at it you may as well remove "Label 4", since without a "Go to 4" anywhere in the script that line is not doing anything.
Look at what's happening: when you use the accessory at (10,8) or (10,9) the first "If" evaluates as true, so the three inner lines are activated, including "Go to 2". This jumps to "Label 2". The next command is an "If": is the player at (2,11) to (4,11)? No, of course not, we just said he's at (10,8) or (10,9). So this evaluates as false and the "Else" part is activated, making the player say "Can't use it here."
I think what you were trying to achieve with "Go to 2" was making the script jump over the first "If" so that it couldn't be used to remove an item from (9,8) twice? Learn that "If" isn't "Wait". Once the script reaches the second "If", it will check once whether the condition is true, see that it isn't, do the "Else" bit and then do whatever comes after the "If", which here makes it jump right back to Label 1 again.
If you remove "Go to 2" and "Label 2", the script will work, but it will be possible to remove an item from (9,8) twice. That's only important if some other script can put an item back on that square after this script has removed one, though. If that is the case and it's important to you to prevent the item removal happening twice, put an "If... Wait until var "ShovelFill = 0" " inside that first "If". (Custom variables whose values have not yet been set evaluate to 0.)
Let me know if there's anything you need me to go over again.
____________________________
50th Skywatcher
|