Function: SetPosition(spawn, x, y, z, heading)
Description: Sets the current position and stored origin coordinates to the supplied coordinates. A nonzero heading also updates heading; zero preserves the current heading. Player movement uses the existing movement packet path.
Spatial membership updates retain the original actor and publication epoch. Replacement cell/member nodes and bucket capacity are prepared before the membership move commits, and cleanup from an older allocation cannot remove a replacement actor's entry. This lifetime contract does not make all mutable position fields a single atomic snapshot.
Parameters:
spawn(Spawn) - Spawn object representingspawn.x(float) - Position component or heading value.y(float) - Position component or heading value.z(float) - Position component or heading value.heading(float) - Position component or heading value.
Returns: None.
Connection lifetime: Each player or group-member connection resolved by this function is retained through the native call. A disconnect or reconnect during a callback cannot destroy that retained connection or switch the ongoing call to a replacement. A later Lua call resolves the current connection. This does not extend the lifetime of unrelated spawn or item userdata.