🔴Step 3 - Let's setup the potions

In this step, you'll be setting up the FixPJ trigger event and the properties of different types of potions that players can use within your game.

Let's break down the setup:

First, add your FIXPJ trigger event

To add your FixPJ trigger event to the script, first open the file resources/[ks_myspells]/ks-magic/custom/client.lua

Then, locate the line 19 or search for the function 'Custom:RestorePlayerModel(cb)'

An here you do two things:

  1. Add your FixPJ trigger event

  2. Change the cb(false) to cb(true) .

Here is an example using a custom QB-Core installation with an added command for resetting the character "/reloadSkin" in the file resources/[qb]/qb-clothing/client/main.lua:

Then, configure the potions as you like

To configure the potions, first locate the file resources/[ks_myspells]/ks-magic/config.lua and open it

Then search for the 'Config.Potions' table and edit the "value", "time" and "animals" according to your needs:

Here is what the variables do:

  • Healing potion - 'value' : How many health points can the player be healed

  • Shield potion - 'value' : How many shield points can the player be armored up

  • Animals potion - 'time' : How much time the player will be come animal

  • Animals potion - 'animals' : List of creatures that the player can transform randomly (Visit https://docs.fivem.net/docs/game-references/ped-models/#animals for the full list of animals)

  • Invisibility potion - 'time' : How much time the player can be invisible

  • Speed potion - 'time' : How much time the player will sprint faster

And remember to save the files! :3

Last updated