I am trying to teleport a BaseNPC.
With BasePlayer you can do (from some plugin, i don't remember which one):
But I have no idea how to teleport a BaseNPC. I am doing it by killing the npc and spawning on other position but I was wondering if is possible to teleport a BaseNPC.Code:player.MovePosition(position); if (player.net?.connection != null) player.ClientRPCPlayer(null, player, "ForcePositionTo", position); player.TransformChanged(); if (player.net?.connection != null) player.SetPlayerFlag(BasePlayer.PlayerFlags.ReceivingSnapshot, true); player.UpdateNetworkGroup(); player.SendNetworkUpdateImmediate(false); if (player.net?.connection == null) return; try { player.ClearEntityQueue(null); } catch { } player.SendFullSnapshot();
Solved Teleporting a BaseNPC?
Discussion in 'Rust Development' started by Reynostrum, Aug 31, 2016.
-
Does 'npc.transform.position = newposition' not work?
-
Yes it work. Thank you!
