Script Compilation Error

Post » Thu May 07, 2015 10:22 pm

I have tried retyping this script and this error just keeps coming up whenever I try to compile: "mismatched input '' expecting ENDIF" What am I doing wrong? Here's the script:


;=========================
;PROPERTIES
;=========================

Message Property ZyMenu Auto

Armor Property ArmorIronCuirass Auto
Armor Property ArmorSteelCuirass Auto

MiscObject Property Gold001 Auto

;=========================
;EVENT
;=========================

Event OnActivate (ObjectReference akActionRef)
Menu()
EndEvent

Function Menu (int aiButton = 0)
aiButton = ZyMenu.show()
If aiButton == 0

ElseIf aiButton == 1
If (Game.GetPlayer().GetItemCount(Gold001) >=100)
Game.GetPlayer().RemoveItem(Gold001, 100)
debug.messagebox("You have purchased Iron Armor")
Game.GetPlayer().AddItem(ArmorIronCuirass)

ElseIf aiButton == 2
If (Game.GetPlayer().GetItemCount(Gold001) >=150)
Game.GetPlayer().RemoveItem(Gold001, 150)
debug.messagebox("You have purchased Steel Armor")
Game.GetPlayer().AddItem(ArmorSteelCuirass)

EndIf

Thanks for any help! :)

#NOTE# I know that there may be some missing 'EndIfs' but when I add them, the error still occurs.
User avatar
Avril Churchill
 
Posts: 3455
Joined: Wed Aug 09, 2006 10:00 am

Post » Thu May 07, 2015 8:46 pm

Here you go:

;=========================;PROPERTIES;=========================Message Property ZyMenu AutoArmor Property ArmorIronCuirass AutoArmor Property ArmorSteelCuirass AutoMiscObject Property Gold001 Auto;=========================;EVENT;=========================Event OnActivate (ObjectReference akActionRef)    Menu()EndEventFunction Menu (int aiButton = 0)    aiButton = ZyMenu.show()    If aiButton == 0    ElseIf aiButton == 1        If (Game.GetPlayer().GetItemCount(Gold001) >= 100)            Game.GetPlayer().RemoveItem(Gold001, 100)            debug.messagebox("You have purchased Iron Armor")            Game.GetPlayer().AddItem(ArmorIronCuirass)        endif    ElseIf aiButton == 2        If (Game.GetPlayer().GetItemCount(Gold001) >= 150)            Game.GetPlayer().RemoveItem(Gold001, 150)            debug.messagebox("You have purchased Steel Armor")            Game.GetPlayer().AddItem(ArmorSteelCuirass)        endif    EndIfEndEvent

Also, for future reference, use [code=auto:0] tags. :smile:
User avatar
Emmi Coolahan
 
Posts: 3335
Joined: Wed Jan 24, 2007 9:14 pm


Return to V - Skyrim