Nuno Radio Man Scripts
  • Documentation
    • 🔫Robbery
      • 🛠️Installation
      • 📃Items
      • 📔Door Docs
      • 📘NPC Docs
      • 📗Interactable Docs
      • 📕Laser Docs
      • 📙Robbery Spawn Docs
      • 📖Robbery Minigames
      • 📓Robbery Events
    • 👷Job
      • 🛠️Installation
      • 📑Items
      • 📔Blip Docs
Powered by GitBook
On this page
  1. Documentation
  2. Robbery

Interactable Docs

Docs for built-in interactable system.

Here is the official documentation for the interactable system

Every Interactable has it own variables such as item_to_give. So you have to set the items for every single interactable, this makes so you can have a lot of customization.

cfg_robbery.lua
interactables = {
    {
	type = "interactable_example_01", -- type of loot
	
	spawn = {
	    type = "normal", -- "nospawn" "normal" "rarity" "rarity_loot"
    	    model = GetHashKey("model"), -- interacatable model that will spawn | This only works when type is "normal"
	    models = { -- This only works when type is "rarity" or "rarity_loot"
	        {GetHashKey("model"),100.0}, -- {model_hash,percentage}
	        {GetHashKey("model"),100.0}, -- {model_hash,percentage}
	        {GetHashKey("model"),100.0}, -- {model_hash,percentage}
	    },
	    position = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}, -- {pos_x,pos_y,pos_z,rot_x,rot_y,rot_z,offset_x,offset_y,offset_z,offset_heading}
	    positions = {
	        {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}, -- {pos_x,pos_y,pos_z,rot_x,rot_y,rot_z,offset_x,offset_y,offset_z,offset_heading}
	        {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}, -- {pos_x,pos_y,pos_z,rot_x,rot_y,rot_z,offset_x,offset_y,offset_z,offset_heading}
	        {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}, -- {pos_x,pos_y,pos_z,rot_x,rot_y,rot_z,offset_x,offset_y,offset_z,offset_heading}
	    },

	    freeze = true, -- if true the interactable will be frozen
	    islocal = true, -- if true the interactable object will be spawned client-side
	    delete = true, -- if true the interactable object will be deleted when done
	
	    only_spawn_if_interactable_isdone = {1,2,3}, -- {index,...} | This interactable object only gets spawned when all of the interactables inside this variable are done
	    only_spawn_if_interactable_exists = {1,2,3}, -- {index,...} | This interactable object only spawn if the interactables objects inside the this variable exists
	},

	target_zone = {0.0,0.0,0.0,0.0,0.0,0.0,0.0}, -- {length,width,height,offset_x,offset_y,offset_z,distance}
	options = {
	    {
	        type = "example_01",
	
		item_needed = { -- this variable is responsible for requiring an item to interact with the interactable
    		    {"item_name",1,100.0}, -- {item_name,item_amount,percentage_to_remove}
    		    {"item_name",1,100.0}, -- {item_name,item_amount,percentage_to_remove}
		},
		
		item_to_give = {
    		    [GetHashKey("hash")] = { -- This is the hash of the interactable  object.
        	       type = "normal", -- "normal" "random" "server" | normal , will try to give every item by percentage,
        	       items = {
            		    {"item_1",1,1,100.0}, -- {item_name,item_amount_min,item_amount_max,item_percentage}
        	       },
    		    },
    		    [GetHashKey("hash")] = { -- This is the hash of the interactable  object.
        		type = "random", -- "normal" "random" "server" | random, will give a random item.
        		items_random_amount = 2, -- this variable controls how many items it will give.
        		items = {
            		    {"item_1",1,1}, -- {item_name,item_amount_min,item_amount_max}
            		    {"item_2",1,1}, -- {item_name,item_amount_min,item_amount_max}
            		    {"item_3",1,1}, -- {item_name,item_amount_min,item_amount_max}
        		},
    		    },
    		    [GetHashKey("hash")] = { -- This is the hash of the interactable object.
        		type = "server", -- "normal" "random" "server" | server, will give an item by percentage | THIS ONLY WORKS ON SOME INTERACTABLES
        		items = {
            		    {"item_1",1,1,50.0}, -- {item_name,item_amount_min,item_amount_max,item_percentage}
            		    {"item_2",1,1,30.0}, -- {item_name,item_amount_min,item_amount_max,item_percentage}
            	  	    {"item_3",1,1,20.0}, -- {item_name,item_amount_min,item_amount_max,item_percentage}
        		},
    		    },
		},

		minigame = { -- this is the minigames that will get played, you can add multiple minigamaes
		    { -- 1
		        event = "CORE_ROB_MINIGAMES:SignalMinigame_c",
		        data = {},
		    },
		},

	        interactions = {
		    markermenu = {"[1] Hack Laptop",157}, -- {text,control_key}
	            displayhelp = {"~INPUT_SELECT_WEAPON_UNARMED~ Hack Laptop",157}, -- {text,control_key}
		    target = {"Hack Laptop","fa-solid fa-laptop"},-- {label,targeticon}
		},

		checkforpolice = true, -- if true when you interact it will check for the police before you start the interaction.
		camera = true, -- if true this will enable a cinematic camera
		dispatch = {
		    call = true, -- if you want this option to call the police set to "true" otherwise set to "false".
		    delay = 5, -- Delay to call the police when you start the action, it is in "seconds".

		    code = "00-00", -- Code Prefix to "title"
		    message = "Example is getting robbed.", -- Notification
		    sprite = 772, -- sprite of the blip
		    color = 1, -- colour of the blip
		    scale = 1.0, -- scale of the blip
		    time = 300, -- Time in seconds that will take to the dispatch to dissapear
		},
	    },
	},
    },
}

PreviousNPC DocsNextLaser Docs

Last updated 1 year ago

🔫
📗