And if theres a way, could i have an example? I want to know this so i can study how it works and advance with my plugin development.
my code :
EDIT : I forgot to spawn it. Sorry lol.Code:[ChatCommand("bodyguard")] private void BodyGuard(BasePlayer plr, string command, string[] args) { if (args.Length == 0) { SendReply(plr, "Welcome to the bodyguard help menu! /bodyguard add -- Adds a bodyguard."); } else { switch(args[0]) { case "add": BaseEntity thing = GameManager.server.CreateEntity("assets/prefabs/npc/scientist/scientist.prefab", plr.transform.position); thing?.Spawn(); SendReply(plr, "Successfully added!"); var scientist = thing.GetComponentInParent<NPCPlayerApex>(); scientist.health = 13f; break; } } }
Solved How would i spawn a scientist with 13 health?
Discussion in 'Rust Development' started by ZyKron, Mar 5, 2018.