🦥
Project Sloth
  • 🦥Project Sloth
  • ⭐Server Hosting | 1 of 1 Servers
  • Scripts
    • ❤️ps-hud
      • Installation Guide
      • Previews
    • 🪄ps-buffs
      • Available Buffs
      • Creduts
    • 👮ps-dispatch
      • Installation
      • Using Exports
        • Creating New Alerts
          • Using your or our Exports
    • 💻ps-mdt
      • Installation
      • Showcase
      • Credits
    • 👾ps-ui
      • Circle Minigame
      • Number Maze
      • VAR
      • Thermite
      • Scrambler
      • Display Text
      • Status UI
      • Menus
      • Input
      • Show Image
      • Show Notification
    • 🌱ps-drugprocessing
      • Previews
    • ⛽ps-fuel
      • Installation Guide
      • Features
      • Showcase
    • 🚞ps-objectspawner
      • Installation Guide
      • Features
      • Showcase
      • Credits
    • 🚓ps-liveries
      • Showcase
      • Credits
    • 🏠ps-housing
      • Installation
      • Features
      • Showcase
      • Adding Shells
      • Migration
      • Credits
    • ⚙️ps-discord
      • Installation
      • Convars
      • Exports
      • Credits
  • ❓FAQ
    • Frequently Asked Questions
      • Warnings
      • PS-HUD
      • PS-DISPATCH
      • PS-MDT
      • PS-UI
      • PS-DRUGPROCESSING
      • PS-OBJECTSPAWNER
      • PS-LIVERIES
Powered by GitBook
On this page
  1. Scripts

ps-buffs

PreviousPreviewsNextAvailable Buffs

Last updated 2 years ago

DEPENDENCY

PS-HUD:

General Information

  • Buffs are new effects that a player can get. Example: Stamina Buff makes the player run faster

    • They show up as a new icon

  • Enhancements are making statuses you already have better. Example: Health Buff heals a player periodically

    • They show up as yellow on the status they are affecting. Example: Armor buffs makes the armor icon yellow

  • By default adding buffs to a player will just have the buff icon show

    • You need to add logic to give the player buff effects (below you can see examples)

  • Avaliable buffs you can pick from are in the config file (shared/config.lua)

Add a buff to a player
example-buff.lua
-- Function signature - buffName: string, time: int (1 second = 1000)
exports['ps-buffs']:AddBuff(buffName, time)
lua
-- Example -- Adds a hacking buff for 15 seconds, which the player would see a hacking buff icon on their screen
exports['ps-buffs']:AddBuff("hacking", 15000)
Check if player has a buff
example-check.lua
-- Function signature - buffName: string
exports['ps-buffs']:HasBuff(buffName)

-- Example -- Check if a player has the hacking buff and make it easier to hack something
if exports['ps-buffs']:HasBuff("hacking") then
    -- give player more time or less complicated puzzle
end
🪄
https://github.com/Project-Sloth/ps-buffs
https://github.com/Project-Sloth/ps-hud