Donut Team is a labor of love, built and maintained by a small group of passionate developers. We invest our own time and resources to offer our tools, mods, and web services completely free of charge.

We don't run ads, and we will never sell your data - period.

If you've enjoyed anything we've created, please consider supporting our work with a one-time or monthly donation via our Ko-fi page . Every contribution helps us continue building great experiences for the community.

Dismiss
  • Modding Tools
  • Lucas' Simpsons Hit & Run Mod Launcher
  • Hacks
  • Mod Requirable Hacks
  • Additional Script Functionality
  • Console Commands
  • CON Commands

SetConditionalParameter

Available since Version 1.18.

Set parameters on a car depending on various conditions.

Scope

This command should be called within a vehicle's .con file.

Syntax

drawableVisibility Parameter

CON
Lua
SetConditionalParameter("drawableVisibility", vehicle_drawable_name, condition, [condition_value1, ...]);
Game.SetConditionalParameter("drawableVisibility", vehicle_drawable_name, condition, [condition_value1, ...])
  • "drawableVisibility": This type of parameter sets the visibility of a drawable on the car if the condition is true.
  • vehicle_drawable_name: The name of the drawable on the vehicle to show/hide.
  • condition: The condition that determines if the prop is visible.
    • vehicleHealth: A condition that depends on the health of the vehicle.
      • This condition requires 2 more arguments specifying the minimum health and the maximum health for the condition to be true.
    • level: A condition that depends on the level the player is currently in.
      • This condition requires an argument specifying the level that the condition will return true in.

hasdoors Parameter

CON
Lua
SetConditionalParameter("hasdoors", condition, [condition_value1, ...]);
Game.SetConditionalParameter("hasdoors", condition, [condition_value1, ...])
  • "hasdoors": This type of parameter controls whether or not the car has doors if the condition is true.
  • condition: See the "drawableVisibility" section.

highroof Parameter

CON
Lua
SetConditionalParameter("highroof", condition, [condition_value1, ...]);
Game.SetConditionalParameter("highroof", condition, [condition_value1, ...])
  • "highroof": This type of parameter controls whether or not the car has a high roof if the condition is true.
  • condition: See the "drawableVisibility" section.

Examples

CON
Lua
SetConditionalParameter("drawableVisibility", "clfamilyRoof", "vehicleHealth", 0.5, 3.0); 
SetConditionalParameter("drawableVisibility", "clfamilyFood", "level", 1); 

SetConditionalParameter("hasDoors", "vehicleHealth", 1.5, 3.0);

SetConditionalParameter("highRoof", "vehicleHealth", 0.0, 0.5);
Game.SetConditionalParameter("drawableVisibility", "clfamilyRoof", "vehicleHealth", 0.5, 3.0)
Game.SetConditionalParameter("drawableVisibility", "clfamilyFood", "level", 1)

Game.SetConditionalParameter("hasDoors", "vehicleHealth", 1.5, 3.0)

Game.SetConditionalParameter("highRoof", "vehicleHealth", 0.0, 0.5)