1. 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 :
    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;
                    }
                }
            }
    EDIT : I forgot to spawn it. Sorry lol.
     
    Last edited by a moderator: Mar 5, 2018