Bultenen   0 Share Posted August 10, 2020 Hello! 😀 I'm working on a combat script and i want to switch between Attack, Defense etc.. I currently have this: if(getSkills().getRealLevel(Skill.ATTACK) <= 10) { switchCombat(0, 593, 3, 0, "Attack"); } else if(getSkills().getRealLevel(Skill.STRENGTH) <= 10 && getSkills().getRealLevel(Skill.ATTACK) >= 10) { switchCombat(1, 593, 7, 0, "Strength"); } else if(getSkills().getRealLevel(Skill.DEFENCE) <= 10 && getSkills().getRealLevel(Skill.ATTACK) >= 10 && getSkills().getRealLevel(Skill.STRENGTH) >= 10) { switchCombat(3, 593, 15, 0, "Defense"); } But everytime this script always goes into the combat tab widget and chooses "Stab" wich is Attack, even if my attack level is over 10. So what am i doing wrong? 😅 Link to comment Share on other sites More sharing options...
TheRevelo   7 Share Posted August 10, 2020 Does it even continue Stabbing when its 11? Link to comment Share on other sites More sharing options...
TheCloakdOne   389 Share Posted August 10, 2020 Looks like your widget child ID's are incorrect (this is weapon dependant dont forget) Widget cbtWidget = ctx.getWidgets().getWidget(593); if (cbtWidget == null) { return 0; } case ATTACK: cbtWidget.getChild(4).interact(); break; case STRENGTH: cbtWidget.getChild(8).interact(); break; case DEFENCE: cbtWidget.getChild(16).interact(); break; Link to comment Share on other sites More sharing options...
Bultenen   0 Author Share Posted August 10, 2020 4 hours ago, TheRevelo said: Does it even continue Stabbing when its 11? Yes it does 😂 Link to comment Share on other sites More sharing options...
Bultenen   0 Author Share Posted August 10, 2020 1 hour ago, TheCloakdOne said: Looks like your widget child ID's are incorrect (this is weapon dependant dont forget) Widget cbtWidget = ctx.getWidgets().getWidget(593); if (cbtWidget == null) { return 0; } case ATTACK: cbtWidget.getChild(4).interact(); break; case STRENGTH: cbtWidget.getChild(8).interact(); break; case DEFENCE: cbtWidget.getChild(16).interact(); break; OH yeah that makes sense! Will try and will most definitely work! Thank you 😊 Link to comment Share on other sites More sharing options...
TheRevelo   7 Share Posted August 10, 2020 1 minute ago, Bultenen said: Yes it does 😂 Did you try out @TheCloakdOne 's solution? Edit: Just reloaded page and saw that you already answered, nvm. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.