Item Use Effect API
🧃Advices to use the item effects
The dream_vending
script uses a centralized system (DreamCore.Items
) to define how items affect the player when used. This API enables you to easily assign effects to items such as healing, animations, or visual effects like drunkenness.
🔧 Usage
To make an item usable with effects, define it in the DreamCore.Items
table with a use
function:
💡 Note: If another script manages the item, simply don’t include it in
DreamCore.Items
.
⚙️ Supported Effect Types
Below is a list of supported type
values for the dream_vending:client:ApplyItemEffects
event:
🩺 addHeal
Increases the player's health.
💔 removeHeal
Reduces the player's health.
🛡️ addArmor
Increases the player's armor.
💥 removeArmor
Reduces the player's armor.
🍔 eatAnim
Plays an eating animation. Optionally set a prop.
🥤 drinkAnim
Plays a drinking animation. Optionally set a prop.
🍻 drunk
Applies a drunk visual and movement effect.
Optional parameters:
intensity
(float): Camera shake strengthveryDrunk
(boolean): Changes walking style
⏱️ Delayed Effects
You can delay an effect with the timeout
parameter (in milliseconds):
💡 Tips
You can stack multiple effects in a single item.
Try to stay realistic: a whiskey contains more alcohol than just a piña colada.
Use props that exist in GTA V (e.g.,
prop_ecola_can
,ng_proc_coffee_01a
, etc.).Want custom effects? Add new
effectType
handling to theApplyItemEffects
event (You need to buy the source version).
Last updated