November 15, 20169 yr Hello guys! I've recently started getting in to scripting and im trying to make a script that mines Tin untill 15 mining and then starts mining Iron. I ran in to a problem where it says "unreachable code" when i added Another state. I know the code is horrible, but if you can explain what im doing wrong, I would be thankfull. private State getState() { if(MINING_AREA.contains(player) && skills.getStatic(Skill.MINING) >= 15); return State.MINEIRON; // I get the error here if(MINING_AREA.contains(player) && skills.getStatic(Skill.MINING) <15); return State.MINETIN; if(getInventory().isFull()) return State.WALKBANK; if(!getInventory().isFull() && !MINING_AREA.contains(player)); return State.WALKMINE; if(BANK_AREA.contains(player)) return State.BANK; return State.WAIT; }
November 15, 20169 yr Hello guys! I've recently started getting in to scripting and im trying to make a script that mines Tin untill 15 mining and then starts mining Iron. I ran in to a problem where it says "unreachable code" when i added Another state. I know the code is horrible, but if you can explain what im doing wrong, I would be thankfull. private State getState() { if(MINING_AREA.contains(player) && skills.getStatic(Skill.MINING) >= 15); return State.MINEIRON; // I get the error here if(MINING_AREA.contains(player) && skills.getStatic(Skill.MINING) <15); return State.MINETIN; if(getInventory().isFull()) return State.WALKBANK; if(!getInventory().isFull() && !MINING_AREA.contains(player)); return State.WALKMINE; if(BANK_AREA.contains(player)) return State.BANK; return State.WAIT; } You have ; after your if statements, remove them and it should work Edited November 15, 20169 yr by Explv