#PlayerJoin

1 messages · Page 1 of 1 (latest)

muted timber
#
 world.beforeEvents.getPlayers(players =>  {
  if (world.getPlayers.PlayerSpawn(length == !0));
  try {
    player.runCommandAsync("say hi")
  }
})
world.beforeEvents.getPlayers(players =>  {
  if (world.getPlayers.PlayerSpawn(length == !0));
  try {
    player.runCommandAsync("say hi")
  }
})
manic turret
#

well. first. Event function is wrong.

muted timber
#

is it playerSpawn

manic turret
#

yes.

muted timber
#

world.beforeEvents.playerSpawn.subscribe(players =>  {
  if (world.getPlayers.PlayerSpawn(length == !0));
  try {
    player.runCommandAsync("say hi")
  }
})
world.beforeEvents.getPlayers(players =>  {
  if (world.getPlayers.PlayerSpawn(length == !0));
  try {
    player.runCommandAsync("say hi")
  }
})```
manic turret
#

so.

world.beforeEvents.playerSpawn.subscribe(ev => {
//code here
});
#

Second. Why get all players just to check if noone else is online. Also that implementation is wrong

#

player spawn is actually an afterEvent

muted timber
manic turret
#

u should do....

world.afterEvents.playerSpawn.subscribe(ev => {
if(ev.initalSpawn)
{
   player.runCommandAsync("say hi");
}
});