Ok so i have been working on my first ever minigame for a while now and i dont wonna start over again, I have it so when a player creates a sign they join a list whenever a player join/leave on the 4th line on the signs there is a player counter for the list of the sign by doing this.getConfig.getStringList(list path...).size() it works good but now i came to a point where i want it so when there is atleast 2 players in the list it will start a separate timer for just that list and it will stop if the list.size ever goes down under 2. I really dont wonna start over again it my first one ever and i have been working on it for like 5 days straight, and the signs and stuff have a lot more stuff with them but that doesnt matter with this. Anyone have any ideas how i cna make the countdown timers?
xTrollxDudex The thing is i have to make it in a way so the timer is only for the people in that list. and if another list that has 2 people in it and wants to start a new timer while the other one is working it will start butit wont effect the other one. i just want like separated timers basically. is it possible?
xTrollxDudex Lets say there is a list witch activated a timer and it sends like 30 seconds left ect... to only the players in that list. and while that timer is working another list activates the timer and it does the same thing it tells the message only to the people in the list that activated it and it wont react to any other timers that are working.
zakkinu2 That's really difficult to understand but I think you are trying to have multiple lists of players and have a separate countdown for each of them? You need objects to do this.
zakkinu2 When a player joins a game, check the size of the list and if it is the required size then start up a scheduler. When they leave, if it is below the players required to start a game, you would cancel the schedueler.
xTrollxDudex I already know how to test the size of the list and stuff but the problem is when i dont know how to do the schedueler works for multiple lists at 1 time. Cause whenever i try it i need to have an integer like: int x = 30; whenever i do x--; if another list activates the countdown it gets messed up and like the int will start going 2 times faster and stuff. xTrollxDudex its just i dont know how to do it. do you think you can show me how? the schedueler chasechocolate do you think you can help me i really need help i have been searching for over a whole day! please. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
zakkinu2 Code:java new BukkitRunnable(){ int seconds = 60; @Override public void run(){ if(the arena size > 2){ if(time > 0){ //Broadcast message time -= 1; } else { this.cancel(); return; } } else { this.cancel(); return; } }}
chasechocolate i tried a similar way to that the only problem is if an arena activates it and after like 7 seconds another arena activates it will mess up. thats why i want it to be separated for every list, if thats even possible?
zakkinu2 yeah, you would send a message to every player in a list. Check out xTrollxDudex 's arena tutorial in the resources section.
chasechocolate ok so i tried to understand what xTrollxDudex arena was about. but i still had problems understanding how he makes separate arenas and stuff. Now i know basic stuff like adding people to a list setup config and stuff with config and some event and like small stuff.. i know im not ready for that stuff yet. Where is the best place to learn all this stuff?