EmperorZenos Posted December 17, 2008 Report Share Posted December 17, 2008 Whenever U try to utilize my script (in anyway) the script fails to do anything. My JavaScript debugger (FireBug) says that there's a syntax error somewhere, but I can't spot where. // START Universal Variablesvar wea="IROSWO";var en="\n";// END Universal Variables// START STATSvar statATK=0;var statHP=15;var statDEF=4;var statEXP=0;var statLVL=1;var statMP=5;// END STATS// START COMMANDSfunction func() {var line=document.getElementById("command").value;var g=document.getElementById("Constue").value+line;if (line=="cls") {document.getElementById("Constue").value="";}if (line=="equip \"Iron Hammer\"") {document.getElementById("Constue").value=g+"\n";document.getElementById("WEAP").src="wea_hm.gif";document.getElementById("wea_name").innerHTML="Iron Hammer";var wea="IROHAM";}if (line=="equip \"Iron Sword\"") {document.getElementById("Constue").value=g+"\n";document.getElementById("WEAP").src="wea_sw.gif";document.getElementById("wea_name").innerHTML="Iron Sword";var wea="IROSWO";}} // END COMMANDS// START STAT MODS // IRON SWORD if (wea=="IROSWO") { if (statATK!=0) { var statA2=statATK-statATK; var statATK=statA2+5; } } else { var statATK=0+5; } var curwea="Iron Sword"; } // IRON HAMMER if (wea=="IROHAMMER") { if (statATK!=0) { var statA2=statATK-statATK; var statATK=statA2+6; } else { var statATK=0+6; } var curwea="Iron Sword"; }// END STAT MODS// START STAT SHOWfunction s() { alert("HP: "+statHP+en+"Attack: "+statATK+en+"Defense: "+statDEF+en+"Experience: "+statEXP+en);}// END STAT SHOW Here's the address of the script in case it is of any use: http://swordshieldco.site50.net/DFTPX/ui.html Link to comment Share on other sites More sharing options...
Synook Posted December 17, 2008 Report Share Posted December 17, 2008 Firebug tells you the line number if (wea=="IROSWO") { if (statATK!=0) { var statA2=statATK-statATK; var statATK=statA2+5; } } else { var statATK=0+5; } var curwea="Iron Sword"; } //<--------- See the error now? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now