Jump to content

Skeleton Sword Script :( not working


JadeStoneX

Recommended Posts

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

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...