Simple NPC
Description
Add a non-player character who says Hello World
Structure
Files
npc.ts
import { RpgEvent, EventData, RpgPlayer } from '@rpgjs/server'
@EventData({
name: 'EV-1'
})
export default class CharaEvent extends RpgEvent {
onInit() {
this.setGraphic('female')
this.setHitbox(16, 16)
}
async onAction(player: RpgPlayer) {
await player.showText('Hello World')
}
}