How do I make the quickest respawntime possible on a 5cp map?

mat_mot0

L2: Junior Member
Feb 11, 2018
88
4
I'm making a 5cp map and the respawntime on it is set to zero (When you die there is no respawn timer count down above your class icon) but it still takes a couple seconds to spawn. How can it be set so a player may respawn instantly without any delay whatsoever?
 

Box Of Paper

L3: Member
Jul 15, 2019
121
148
How about a "logic_relay" that sets up the "player_death" event to call "DispatchSpawn()" on the dead player? An "EntFireByHandle" is necessary or it looks weird, but thanks to it you may specify a delay of your choosing.

Just place a "logic_relay" and give it an output:
OnSpawn !self RunScriptCode "ClearGameEventCallbacks(); function OnGameEvent_player_death(info) {EntFireByHandle(GetPlayerFromUserID(info.userid), `RunScriptCode`, `self.DispatchSpawn()`, 0, null, null); printl(`Player died!`)}; __CollectGameEventCallbacks(this)"
(The "0" is the delay argument)

If the map already uses VScript's GameEvents then you gotta register the function according to how the map is setup.
 

Attachments

  • insta_respawn.vmf
    21.8 KB · Views: 52
Last edited: