int logCount;
@Override
public void onMessage(Message m){
if (m.getType().equals(Message.MessageType.GAME) && m.getMessage().toLowerCase().contains("oak logs")){
logCount++;
}
}
You're not null checking your widget, which is probably why the script freezes. I'd also look into using an alternative method to find your widget as using static IDs isn't the best practice when there's so many other ways to do it.
This, Just a heads up though you don't need to setAllowObstacles as the boolean is already set to true on execution of the event. Teleports you do need to set though