[Command] getPersonHere

Post Reply
User avatar
Raddeck
LP Manager
Reactions: 1
Posts: 508
Joined: Sat Oct 16, 2021 6:22 pm
Location: LpWorld
Contact:

Post by Raddeck »

getPersonHere(optional bool permanent)


USE:
Returns a person in the current building / location.

If parameter 'bool permanent' is true only permanent actors will be returned.
If its false only temporary NPCs will be returned.
If its omitted all NPCs will be returned.
The function will return an invalid Actor as soon as there are no more NPCs in the location.


TYPE: Command, Reference
RETURNS: Actor
THEME: NPCs
COMPARE: getSpecific(), getPerson(), clearGetList()


EXAMPLE:

Code: Select all

    cnt = 0
    While getPersonHere().isValid()
        cnt += 1
    EndWhile
    
    "There are <cnt> people in this building."
    clearGetList()  // to be able to use the getPerson* calls again in this scene
Like my work? Buy me a coffee or support me on Patreon to keep it coming. :ugeek:
-Don't PM me for support-
Top
Post Reply