Hello and welcome to the forum!
Put the script in a hp.vue
file in the folder you want. Here is a proposed structure:
Next, add in src/modules/main/client/index.ts
import { RpgClient, RpgClientEngine } from '@rpgjs/client'
import hp from './gui/hp.vue'
@RpgModule<RpgClient>({
gui: [
hp
]
})
export default RpgClientEngine { }
The main thing is to connect the GUI in the module
And second : does the script is adaptable for an exp bar ?
Of course, you have almost no limits on the GUIs
In the script,
- replace
hp
by exp
- replace
maxHp
by expForNextlevel
https://docs.rpgjs.dev/commands/parameter.html#change-experience