Dab in a Lab Posted May 5, 2018 Share Posted May 5, 2018 Can anyone tell me why this statement is unreachable? If I mess around with the brackets to get the statement reachable, the else statement isn't paired with any if statements anymore. Its on line 43 https://gyazo.com/c840ffe12d80c78008ce9c1f6f1cc31c And if anyone could give me feedback or pointers for the code I have right now, that would be really appreciated. https://github.com/Dab-in-a-Lab/Wilderness-Looter/blob/master/Current Code Quote Link to comment Share on other sites More sharing options...
Theorems Posted May 5, 2018 Share Posted May 5, 2018 Looks a bit messy... Are you declaring a method in your onLoop()? also you have a return statement right after you declare the method so all the code that follows in unreachable. Also what's with the random curly brackets on line 41? that could also be causing issues. 1 Quote Link to comment Share on other sites More sharing options...
Dab in a Lab Posted May 5, 2018 Author Share Posted May 5, 2018 14 minutes ago, Theorems said: Looks a bit messy... Are you declaring a method in your onLoop()? also you have a return statement right after you declare the method so all the code that follows in unreachable. Also what's with the random curly brackets on line 41? that could also be causing issues. Hahaha ya, I quickly realized I was a little too ambitious with this script. Only just started learning how to code this week, and the project seemed easy enough until I actually got a bit further into it I fixed the return statement and I honestly don't know why the curly bracket was there, I think it was attached to the end of line 40? It seems to be working for now, thank you. 1 Quote Link to comment Share on other sites More sharing options...
Theorems Posted May 5, 2018 Share Posted May 5, 2018 22 minutes ago, Dab in a Lab said: Hahaha ya, I quickly realized I was a little too ambitious with this script. Only just started learning how to code this week, and the project seemed easy enough until I actually got a bit further into it I fixed the return statement and I honestly don't know why the curly bracket was there, I think it was attached to the end of line 40? It seems to be working for now, thank you. Good luck with the script! you're doing really well for someone who is just learning 1 Quote Link to comment Share on other sites More sharing options...