here is some more detail on area's
if you have a area you want to make imagine a square has four edges, you need to diagonally oppersite edges to make that square in your script. Look at the image below:
I have wrote down two sets of X & Y co'ordinates. The top left and the top right. So top left you have X = 1318 and Y = 3238. Bottom right we have X = 1320 and Y = 3240. Now you have your box or area. We need to put this into our script.
We first need to declare the area. This can put put at the top of your script under:
public class YourScriptName extends Script
{
// put area declaration here
so what code do we put? ok so look at the code below then i'l explain it.
Area areaName = new Area(1234,1234,1234,1234);
ok so look at the code above. We have Area which you should always put first, its saying you are going to declare a new area. then you see ' areaName ' this is going to be the name of your area so you could call it something like ' bankArea ' or ' cuttingArea ' just make sure its one word no spaces. You can use underscores if you wish. Use basic variable naming conventions. After the name of our area we have four co'ordinates 1234 1234 1234 1234 these are the X and Y co'ordinates. If we use the picture above i showed you as an example it would be:
Area areaName = new Area(1320,3240,1318,3238);
notice i put the bottom right set first, then the top right set. This is how i was told to do it when i learnt and its worked for me in all my scripts, there may be other ways as Josed said above. So now you have delcared your area at the top of your script you need to use that code. So lets have another example. Imagine if you will that you want to know if your player is in a bank. You can use something like this:
if(areaName.contains(myPlayer())
{
// do something
}
I have used the same area name as before so not to confuse you but you put the name of your area. then a full stop and then you can test that area for players, variables, objects etc. I have chosen to use myPlayer() as we wanted to check if our player was within an area.
if you need any more help post back here
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SECOND POST FOR YOU.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
also here is an example gui class is just whipped up for you, i tried to comment most of it so you can follow whats happening, any question post here.