C# Using Exports to Control Spawn

I am try to figure out how to use exports to control spawnmanager. This is what I have…

     public class Client : BaseScript
     {
         public Client()
         {
             Exports.Add("spawnPlayer", new Action(OnPlayerSpawn));
             EventHandlers["onClientMapStart"] += new Action(OnClientMapStart);
         }
         public void OnPlayerSpawn()
         {
             Debug.Write("******OnPlayerSpawn******");
         }
         public void OnClientMapStart()
         {
             Debug.Write("******OnClientMapStart******");
             Exports["spawnmanager"].setAutoSpawnCallback(false);
         }
 
     }

Am I using Exports[“spawnmanager”].setAutoSpawnCallback(false); correctly to prevent spanwmanger from initiating a spawn? Once this is successful, I will to tell spawnmanager where to spawn.

When I run the script, I still spawn, but I so not see the Debug.Write from OnPlayerSpawn.

I am very poor at Lua, but working on improving.

Thanks

1 Like