dockfries / infernus

Node.js library for scripting Open Multiplayer.
https://dockfries.github.io/infernus/
MIT License
21 stars 2 forks source link

The pickup does not appear #22

Closed Andonrai closed 1 year ago

Andonrai commented 1 year ago

I'm trying to create a pickup, but it doesn't show up in the game

Used code:

Values ​​returned when creating the pickup:

dockfries commented 1 year ago

image

There doesn't seem to be an issue.

Have you instantiated this object within the GameMode's OnInit function?

Are the characters located within the same virtual world and coordinates?

Please keep in mind that all game-related actions should be performed within the callback event, and not outside of it.

Additionally, please note that the "I" in modelid should be lowercase

import { GameMode, DynamicPickup } from "@infernus/core";

const gm = new GameMode();
gm.onInit = () => {
  new DynamicPickup({
    modelid: 19135,
    type: 1,
    x: 1536.8569,
    y: -1688.5819,
    z: 13.5469,
    streamdistance: 20,
    worldid: 0,
    interiorid: 0,
  }).create();
};
Andonrai commented 1 year ago

image

There doesn't seem to be an issue.

Have you instantiated this object within the GameMode's OnInit function?

Are the characters located within the same virtual world and coordinates?

Please keep in mind that all game-related actions should be performed within the callback event, and not outside of it.

Additionally, please note that the "I" in modelid should be lowercase

const gm = new GameMode();
gm.onInit = () => {
  new DynamicPickup({
    modelid: 19135,
    type: 1,
    x: 1536.8569,
    y: -1688.5819,
    z: 13.5469,
    streamdistance: 20,
    worldid: 0,
    interiorid: 0,
  }).create();
};

Solved, thank you.