Skip to content

Set Area Properties?

Hi I'm new to scripting an need to set the function of an area to:

All areas for the Inn must use the:

Recall_SetAreaBlocked() function

to prevent PCs from stealing keys.

How do I go about doing this?

Thanks in advance :)

Comments

  • GenisysGenisys Member Posts: 37
    edited January 2021
    Stealing Keys? From what a placeable?

    (You could simply make it where the key doesn't spawn into the box if they have one already!)

    You can simply make the key a TagBased Script make a script with the same TagName as the item...

    From there, you'll handle the OnAcquire Event and check to see if the PC has 2+ Keys on them, if so, remove all but one of them... e.g. if (iCount >1) { DestroyObject(oKey); } (E.g. AFTER the first key found)

    It will require an inventory loop (e.g. GetFirstItemInInventory(oPC);
  • ZephiriusZephirius Member Posts: 411
    Genisys wrote: »
    Stealing Keys? From what a placeable?

    (You could simply make it where the key doesn't spawn into the box if they have one already!)

    You can simply make the key a TagBased Script make a script with the same TagName as the item...

    From there, you'll handle the OnAcquire Event and check to see if the PC has 2+ Keys on them, if so, remove all but one of them... e.g. if (iCount >1) { DestroyObject(oKey); } (E.g. AFTER the first key found)

    It will require an inventory loop (e.g. GetFirstItemInInventory(oPC);

    very insightful... but still over my head. :(
  • ForSeriousForSerious Member Posts: 446
    I need more details to be able to help.
    So you have inn areas...
    and keys that can be stolen...
    (Outside of the inn areas? In the inn areas?)
    ...that should not be able to be stolen.
    (From an innkeeper? A chest?)

    The more specific the answer, the more help we can give.
Sign In or Register to comment.