1. Post #1
    Wolfo's Avatar
    July 2010
    359 Posts
    So, when you take a weapon or an item in a HL2DM map, it is supposed to respawn after a while, but it doesn't in GMod.
    I tried making a script but ended up making everything slower for some reason and I'm not planning to waste the rest of my time on that script, so could someone with more knowledge than me make this easy Weapon Respawner script for me?
    Thanks.

  2. Post #2
    Wolfo's Avatar
    July 2010
    359 Posts
    No one so far? Come on, please, is it that hard for you?

  3. Post #3
    Awesome Gmod Servers!
    brandonj4's Avatar
    September 2011
    1,371 Posts
    I'll have a look into this later and see what I can come up with.
    Reply With Quote Edit / Delete Reply Windows 7 Canada Show Events Friendly Friendly x 1 (list)

  4. Post #4
    Awesome Gmod Servers!
    brandonj4's Avatar
    September 2011
    1,371 Posts
    Would you mind showing what you've come up with? I want to see if you started going in the right direction.

  5. Post #5
    Wolfo's Avatar
    July 2010
    359 Posts
    Would you mind showing what you've come up with? I want to see if you started going in the right direction.
    I deleted my code not too long ago, no saves of before. But basically, I was getting a list classes+positions of item_* and weapon_* entities on InitPostEntity hook and then delete all item_* and weapon_* entities to respawn them so the ones taken by players would respawn too every minute.

  6. Post #6
    SeveredSkull's Avatar
    October 2008
    1,346 Posts
    You could make a table and fill it with the locations and a link to the actual entity. At X seconds, iterate through the table, checking if the entity exists. If it does, skip it. If it does not, create a new entity at the locations stored.

    You would need to make some sort of static entity that gives the player the weapon, and removes itself upon coming in contact with the player. Reason being, is the weapon will still exist even if it is picked up by a player, disallowing any further spawning of the new weapon until the player has died (Also assuming players do not drop weapons on their death)

    Hope this helps.