The docs say "Called when a player is attempting to spawn for the first time". I interpreted that as "first time since player data was wiped". But a player who played just yesterday triggered this on his first spawn, then again today. I have not wiped player data. What exactly does "first time" mean in this case?
OnPlayerSpawn hook - called twice for same player?Not An Issue
That is when the player spawns on the server after connection to it.
Hmm... if I want to get the very first time a player connects after a wipe, what should I check? I think I remember seeing a "past lives" thing somewhere...
There isn't a hook for that. You'd have to either store and check something, check for a permission, or check if Rust has something that can provide that.
Does this look correct for what I'm trying to do?
object OnPlayerSpawn(BasePlayer player)
{
if (!player.hasPreviousLife && player.lifeStory.metersWalked == 0)
{
//first time player ever spawned in the server since last player data wipe That may work.
Locked automatically