Functions

List and explanation of all functions and how to use them. (Work in progress)

Basic Information


  • You are able to call premade functions or events.

  • If you call unique names, then you are able to trigger spawning of NPCs or enable action spots.

  • Functions are triggered one by one.

How to call events


Functions = { 
    [1] = {
        type = 'event', 
        eventType = 'client' -- 'client' or 'server'
        name = 'sh-heists:EventExample',
        params? = data: table
        delay? = number -- 1000 = 1 second 
    } 
}

How to call unique functions


Functions = { 
    [1] = { type = 'function', name = 'ANYTHING' },
    [2] = { type = 'function', name = 'SPAWN_PHASE_2' },
}

I mention above that you are able to call your own unique function names. With this feature you can assign NPCs and action spots to these unique names to spawn/create/trigger them. It works also for premade functions like: START, MAIN

List of Premade Functions


Complete list of premade functions and explanation of them.

START


Functions = { [1] = {type = 'function', name = 'START'} }

Triggers 'cooldown' timer of heist, also function Start() that is defined in every heist configuration.

MAIN


This function triggers automatically for player that joins the server. You are not able to call this function, because it has automatic system for that, but you are able to modify the content of this function inside of any heist configuration.

CLEAR


Functions = { [1] = {type = 'function', name = 'CLEAR'} }

Clears all entities and disables checkpoints with actions spots. Only works if heist has ongoing cooldown.

CALL_ALERT


Functions = { [1] = {type = 'function', name = 'CALL_ALERT'} }

Triggers alert to all defined jobs in main config of script.

SET_NPC_STATE


Functions = { 
    [1] = {
        type = 'function', 
        name = 'SET_NPC_STATE',
        params = { 
            heist = string or number, -- ex. 'Humane Labs',
            state = number -- ex. 5
        }
    } 
}

--[[ 
    available states:
        0 - companion
        1 - respect
        2 - like
        3 - neutral
        4 - dislike
        5 - hate
]]

Calling this function you are able to switch relationships between players and npcs in heist.

Read more NPC system functionality at this link

Function List


Functions = {
    { 
        type = 'function', 
        name = 'START' 
    },
    { 
        type = 'function', 
        name = 'CLEAR', 
    },
    { 
        type = 'function', 
        name = 'CALL_ALERT' 
    },
    { 
        type = 'function', 
        name = 'SET_NPC_STATE', 
        params = { state = number } 
    },
    { 
        type = 'function', 
        name = 'FINGERPRINT', 
        params = { chance = number } 
    },
    { 
        type = 'function', 
        name = 'DELETE_ENTITIES', 
        params = { spawn = 'Start' } 
    },
    { 
        type = 'function', 
        name = 'NOTIFY', 
        params = {
            text = 'You sneak in...', 
            type = 'inform',
            time = 3 -- seconds
        } 
    },
    { 
        type = 'function', 
        name = 'DOOR', 
        params = { id = index, open = boolean } 
    },
    { 
        type = 'function', 
        name = 'LASER', 
        params = { matrix = table, settings = table } 
    },
    { 
        type = 'function', 
        name = 'REMOVE_LASER', 
        params = { id = unique_id }
    },
    { 
        type = 'function', 
        name = 'CUTSCENE', 
        params = { cutscene, coords, persons, position } 
    },
    { 
        type = 'function', 
        name = 'TELEPORT', 
        params = { pos = vector4 } 
    },
    {
        type = 'function', 
        name = 'START_GAS', 
        params = { unique_id = number or string, timer = number, locations = table } 
    },
    {
        type = 'function', 
        name = 'STOP_GAS', 
        params = { unique_id = number } 
    },
    {
        type = 'function', 
        name = 'UNLOCK_DOOR', 
        params = { id = number or string, } 
    },
    {
        type = 'function', 
        name = 'LOCK_DOOR', 
        params = { id = number or string } 
    }
}

Last updated