Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. MW3 Modding Support & Discussion
  3. Trying to spawn more than one model.

Trying to spawn more than one model.

Scheduled Pinned Locked Moved MW3 Modding Support & Discussion
3 Posts 2 Posters 94 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • peepundefined Offline
    peepundefined Offline
    peep
    wrote on last edited by
    #1

    Hello Plutonium, I am trying to create a script so I can spawn models with set origin.
    My script DOES work but I have one issue... It only spawns one of the models and won't spawn any more than that. Any help would be appreciated!

    makejumppad(origin, velocity)
    {
        self endon("disconnect");
    
        dospawn = spawn("script_model", origin);
        dospawn setModel("prop_suitcase_bomb");
    
        for(;;)
        {
            if (distance(self getOrigin(), origin) <= 15)
            {
                self setVelocity(velocity);
            }
    
            wait 0.01;
        }
    }
    
    jumppads()
    {
        if (getDvar("mapname") == "mp_courtyard_ss")
        {
            makejumppad((490.875, -2121, 134.676), (50, 0, 430));
            makejumppad((-2957.64, 995.975, 994.125), (50, 0, 430));
        }
    }
    
    1 Reply Last reply
    0
    • mxveundefined Offline
      mxveundefined Offline
      mxve VIP
      wrote on last edited by
      #2

      You are running a loop inside the function you called, so the thread is probably blocked.

      Something like this could work, but idk enough about gsc to be sure.

      level thread makejumppad((490.875, -2121, 134.676), (50, 0, 430));
      level thread makejumppad((-2957.64, 995.975, 994.125), (50, 0, 430));
      

      Best case would probably be that you move your loop to another function and start a thread for the loop function from makejumppad.

      peepundefined 1 Reply Last reply
      0
      • peepundefined Offline
        peepundefined Offline
        peep
        replied to mxve on last edited by
        #3

        mxve Ay thanks for the help!

        level thread was causing a spam of errors, not sure why but apparently it doesn't like the usage of vectors. I switched it to self thread and everything works now!

        1 Reply Last reply
        0

        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Donate