Jump to content

Please check this script for me


JPTR1

Recommended Posts

Hello, could someone check this script for me pls, it's not working.

 

Function should be:

If the "wooden Horn" is in players inventory, remove only this. If player doesn't have the wooden one, then the "golden Horn" should be removed.

If player misses both horns, just the debug message.

 

 

 

Scriptname MansionHornPlaceWoodOrGold extends ObjectReference

ObjectReference Property OrbOfTeenhood Auto
ObjectReference Property Collision Auto
MiscObject Property ItemWood Auto
MiscObject Property ItemGold Auto

Event OnActivate(ObjectReference akActionRef)
if Game.GetPlayer().GetItemCount(ItemWood) == 1) ->Line X1
Game.GetPlayer().RemoveItem(ItemWood, 1, true)
Debug.Notification("The Wooden Warhorn has been placed.")
(GetLinkedRef() as ObjectReference).SetOpen(True)
OrbOfTeenhood.enable()
Collision.enable()

elseif Game.GetPlayer().GetItemCount(ItemGold) == 1) ->Line X2
Game.GetPlayer().RemoveItem(ItemGold, 1, true)
Debug.Notification("The Golden Warhorn has been placed.")
(GetLinkedRef() as ObjectReference).SetOpen(True)
OrbOfTeenhood.enable()
Collision.enable()

else
Debug.Notification("A warhorn rack.")
endif

EndEvent

 

 

Compile error in editor:

LineX1, Col47: required (...)+ loop did not match anything at input ')'

LineX2, Col51: required (...)+ loop did not match anything at input ')'

Link to comment
Share on other sites

  • Recently Browsing   0 members

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