#PlayerJoin
1 messages · Page 1 of 1 (latest)
well. first. Event function is wrong.
is it playerSpawn
yes.
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")
}
})```
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
I'm trying to learn still, it's like my second day of actually trying to write things from stratch. I'm sorry
u should do....
world.afterEvents.playerSpawn.subscribe(ev => {
if(ev.initalSpawn)
{
player.runCommandAsync("say hi");
}
});