Check the code for when someone that is skulled dies,
Then see how its handled
Add it to the normal death
|
Hey guys so I am trying to make it so when players die they will lose all items unless the item protection prayer is activated. This already is the case if the player is skulled so, how would I make it so players are always skulled or so that even if they aren't they will have the same effect?
Check the code for when someone that is skulled dies,
Then see how its handled
Add it to the normal death
Would that be under player.java? Because I've looked at it just super confusing lol.
I can't figure it out ive gone through and changed the skull timers to a super high number, also changed all the isSkulled == false to isSkulled == true. Still doesn't work
I'm a pretty big noob when it comes to things like this too, but this is where I would start in my server.
See if you can find an 'itemsKept' variable, or something of the sort.
As you can see, the items kept if the player is skulled is 0, otherwise it's 3. If you can find something like that, just change them both to 0, meaning whether or not a player is skulled, they will keep 0 items. That's what I would do, anyway.
What server base source are you using?
In the playerdeath method - Remove any code involving the items kept on death
OR just make it so instantly you're skulled when entering the wild.
Remove keep items from death method or make a loop that checks if skull timer = 0 set it to 50000
Replace the code in the picture with the code below.
You should remove the skull above a players' head when attacking another player to avoid confusion.Code:ArrayList<Item> keptItems = new ArrayList<Item>(); int itemsKept = 0; if (isUsingPrayer[Prayer.PROTECT_ITEM]) itemsKept += 1; while (keptItems.size() < itemsKept && allItems.size() > 0) { keptItems.add(allItems.poll()); } return keptItems;
Also, quick tip: don't ever screenshot code. Makes it harder to help because we have to type the whole thing out. It isn't a big deal now because there's little code and I basicly only changed 1 thing but when there's more code it will become a big hassle.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |