Is there a good plugin that has timed spawn protection? I found "Respawn Protection", but some are saying it's broken.
Spawn protection (Rust)
Here's a simple version.
const float protectionSeconds = 60f;
void OnPlayerSleepEnded(BasePlayer player)
{
player.sleepStartTime = -UnityEngine.Time.time;
}
void OnEntityTakeDamage(BasePlayer player, HitInfo info)
{
if (!player.IsSleeping() && player.sleepStartTime + UnityEngine.Time.time < protectionSeconds && info != null)
{
info.damageTypes.ScaleAll(0);
}
} ZugzwangHere's a simple version.const float protectionSeconds = 60f; void OnPlayerSleepEnded(BasePlayer player) { player.sleepStartTime = -UnityEngine.Time.time; } void OnEntityTakeDamage(BasePlayer player, HitInfo info) { if (!player.IsSleeping() && player.sleepStartTime + UnityEngine.Time.time < protectionSeconds && info != null) { info.damageTypes.ScaleAll(0); } }
I'm not a coder, so this means nothing to me.
That code nullifies any damage for 60 seconds after a player wakes up.
I usually don't publish full plugins because I have a chaotic work schedule and can't always maintain things. But if anyone wants to make a plugin for this, the core functionality is right there.
I usually don't publish full plugins because I have a chaotic work schedule and can't always maintain things. But if anyone wants to make a plugin for this, the core functionality is right there.
I can work on this
Done. Still waiting approval.