Events
β‘ Events
You can use these events to integrate Space Addictions with other scripts, such as your inventory or notification systems.
π‘ Client Events
1. π space_addictions:data
Description: Receives the player's current addiction data from the server. Updates the UI.
Parameters:
data(table): Keys are drug names, values are remaining time (minutes) before withdrawal begins
TriggerClientEvent('space_addictions:data', source, addiction_data)2. β‘ space_addictions:setStrength
Description: Sets the player's current drug toxicity level (immunity).
Parameters:
strength(number): Current toxicity value
TriggerClientEvent('space_addictions:setStrength', source, drug_strength_data)3. π space_addictions:useDrug
Description: Triggered when a player uses a drug. Initiates all client-side effects (visuals, animations, etc.).
Parameters:
drugName(string): Item name of the drug usedgotAddicted(boolean): True if addiction occurredpurity(number): Purity level of the drug (if system enabled)
4. π space_addictions:useMedication
Description: Triggered when a player uses an item that cures addiction.
5. π space_addictions:useRemedy
Description: Triggered when a player uses an item that recovers immunity (reduces toxicity).
Parameters:
itemName(string): Item name of the remedy used
6. π§Ή space_addictions:notifyClean
Description: Fired when a player's addictions and toxicity have been cleared (e.g., via admin command).
π₯οΈ Server Events
1. β‘ space_addictions:server:updateStrength
Description: Sent from the client to the server to update and save the player's toxicity level.
Parameters:
newStrength(number): New toxicity value to be saved
Last updated
