JadeStoneX Posted April 19, 2010 Share Posted April 19, 2010 Ok read this whole thing please. I have been making a weapon and its script wont save due to 2 things it says "Invalid End/EndIf block structure on line 29" and 'Script "Test', Line 30 End Without Matching Begin" can some one please fix the script and then show me what i did wrong or just give me the fixed script and i will look at it so i can see what i did wrong. Script:ScriptName Test Ref SkeletonKey Short isSwordKey Begin OnAdd set IsSwordKey to 0 End Begin OnDrop set IsSwordKey to 0 player.removeitem "0000000B", 1 End Begin OnUnEquip set IsSwordKey to 0 player.removeitem "0000000B", 1 End Begin OnEquip If (GetKeyPress 25 == 1) && isSwordKey == 0 Message "Holding Mode: Lock Pick", 10 player.additem "0000000B", 1 set isSwordKey to 1 ElseIf (GetKeyPress 25 == 1) Message "Holding Mode: Normal", 10 player.removeitem "0000000B", 1 set IsSwordKey to 0 End If End Idea CopyWrited so dont steal it!!!!!! :D:D:D Link to comment Share on other sites More sharing options...
razorpony Posted April 19, 2010 Share Posted April 19, 2010 Line 29: 'End If' should be 'EndIf' Delete the space and it should fix your problem. It's trying to end the script on 29 and the 'extra' end on 30 is confusing it. -Razorpony Link to comment Share on other sites More sharing options...
JadeStoneX Posted April 19, 2010 Author Share Posted April 19, 2010 Its still not working heres the new code: ScriptName Test Ref SkeletonKey Short IsSwordKey Begin OnAdd set IsSwordkey to 0 End Begin OnSell set IsSwordKey to 0 player.removeitem "0000000B", 1 End Begin OnDrop set IsSwordKey to 0 player.removeitem "0000000B", 1 End Begin OnUnEquip set IsSwordKey to 0 player.removeitem "0000000B", 1 End Begin OnEquip If (GetKeyPress 25 == 1) && isSwordKey == 0 Message "Holding Mode: Lock Pick", 10 player.additem "0000000B", 1 set isSwordKey to 1 ElseIf (Getkeypress 25 == 1) && isSwordKey == 1 Message "Holding Mode: Normal", 10 player.removeitem "0000000B", 1 set isSwordKey to 1 EndIf The Errors:"Error: Mismatched Block Structure" and "Script 'Test' Line 33 Mismatched Begin/End Block Starting on Line 33" Link to comment Share on other sites More sharing options...
Pronam Posted April 19, 2010 Share Posted April 19, 2010 The last part needs an End, Like this: ScriptName Test Ref SkeletonKey Short IsSwordKey Begin OnAdd set IsSwordkey to 0 End Begin OnSell set IsSwordKey to 0 player.removeitem "0000000B", 1 End Begin ondrop set IsSwordKey to 0 player.removeitem "0000000B", 1 End Begin OnUnEquip set IsSwordKey to 0 player.removeitem "0000000B", 1 End Begin OnEquip If (GetKeyPress 25 == 1) && isSwordKey == 0 Message "Holding Mode: Lock Pick", 10 player.additem "0000000B", 1 set isSwordKey to 1 ElseIf (Getkeypress 25 == 1) && isSwordKey == 1 Message "Holding Mode: Normal", 10 player.removeitem "0000000B", 1 set isSwordKey to 1 EndIf End You don't need to use form-ids in scripts unless you're using a complicated mod-dependency. You can just use the Basic-ID names. Link to comment Share on other sites More sharing options...
JadeStoneX Posted April 20, 2010 Author Share Posted April 20, 2010 Thank You :) Link to comment Share on other sites More sharing options...
Recommended Posts