Passer au contenu principal
Version: latest - a1.156.0 ⚖️

Dimensions

Tout ce que vous devez savoir sur les Dimensions

Qu'est-ce qu'une dimension​

Les dimensions sont des mondes séparés dans le côté client, où les joueurs et les acteurs sont séparés. Dans nanos world, ils sont représentés par des nombres. Il est possible d'avoir jusqu'à 65,535 dimensions différentes.

By default all players and entities are in the dimension 1. En déplaçant un Joueur vers une autre dimension, toutes les entités qui ne sont pas de cette dimension seront détruites à ce joueur, et toutes les entités de la nouvelle dimension apparaîtront pour lui.

Utilisation​

To send an actor or a player to another dimension, the API is very simple (only on the server side):

Server/Index.lua
my_actor:SetDimension(2)
my_player:SetDimension(2)

To send a remote event to all players in a dimension, use:

Server/Index.lua
-- Sends "MatchStarted" to all players in the dimension 2
Events.BroadcastRemoteDimension("MatchStarted", 2, Reliability.Reliable, "some data")

And to send a remote event to players in a dimension near a location, use Events.BroadcastRemoteInRadiusDimension().

You can also change in which dimension new Players and new Entities start with Server.SetDefaultPlayerDimension() and Server.SetDefaultEntityDimension().

Whenever an Actor or a Player changes its dimension, the DimensionChange event is triggered on it.

note

If you send an entity through remote events that is not in the same dimension as the Player, the argument will be replaced by nil and a warning will show up.

Hiérarchie des Acteurs​

En envoyant une entité, leurs "enfants" seront également déplacés vers cette dimension, par exemple :

  • When sending an Actor, all the other attached Actors will move as well.
  • When sending a Player, the Character will move too.
  • When sending a Character, the Player is not moved together, but the grabbing Weapons or Props (and attached Actors) will.
  • When sending a Vehicle, all Characters will leave the vehicle (this will be improved soon™).