For a stock-like working spawn protection in any gametype:
1°/ define a spawn state in mike_torso, to do so:
_ rename STAND state, i just took "NOTDOINGANACTION"
_ rename all references to old STAND state as "NOTDOINGANACTION" in mike_torso and custom scripts if ever
_ add this on top of mike_torso:
2°/ in every ATTACK state + CHARGE_ATTACK_GRENADE + CHARGE_ATTACK_GRENADE_SECONDARY , add "takedamage" in the entry command block (only on _PRIMARY and SECONDARY, not on _CHECK or _RECHAMBER)// Spawn Detection + LeBabouin spawn protect
state STAND
{
states
{
PLAYER_SPAWNED : NEW_WEAPON
}
}
state PLAYER_SPAWNED
{
movetype legs
entrycommands
{
commanddelay 0.05 activatenewweapon
exec global/spawnProtect.txt // execute script on spawned player //nodamage
}
states
{
NOTDOINGANACTION : default
}
}
3°/ add a spawnProtect.txt script in /global, containing only:
4°/ set your wanted sv_invulnerabletime number of seconds in the server configmain:
self nodamage // self is the player that activated the new STAND state
local.wait = int(getcvar "sv_invulnerabletime")
wait local.wait
self takedamage
end