#Why initialSpawn value is true everytime I spawn

1 messages · Page 1 of 1 (latest)

wet wave
weak yacht
# wet wave

not for the first time
when the player join the game (that just filter out respawning from death)

#

you will have to tag hem or add a dp and use that as condition

untold canyon
#

playerSpawn event fires upon player spawning. This includes joining a world and respawning from death.
If initialSpawn is false, you can assume the player has just respawned from death.

untold canyon
#

However, you can check if the player joined for the first time by marking them. Either using a tag, scoreboard, or something else.

Essentially, filtering out old players and new unregistered players.

wet wave
#

I want to implement some custom msg for the players spawned for first time

wet wave
untold canyon
#

It gives the most security if you feel comfortable with it. Sure, go ahead

weak yacht
#
world.afterEvents.playerSpawn.subscribe((event)=>{
const {initialSpawn,player} = event;
const joined= player.getDynamicProperty("joined")
if(initialSpawn && !joined){
  player.sendMessage("wlc")
} else if(initialSpawn){
  player.setDynamicProperty("joined",true)
}
})
wet wave
#

@weak yacht Thanks bro

weak yacht
#

your wlc

#

should be test
i typed it in discord...

wet wave
wet wave
weak yacht
#

tnx
i have no idea how is that channel still getting views

untold canyon