Looking for someone to help me with editing the plugin Indestructable Buildings for Rust | Oxide I don't want the buildings to be indestructible but instead divide the damage by half or 25%.
I know there are other plugins like damage controller but I only want the damage reduced on foundation's.
Code:void OnEntityTakeDamage(BaseCombatEntity entity, HitInfo info) { var block = entity as BuildingBlock; if (!block) return; if (((block.blockDefinition.hierachyName == "foundation" || block.blockDefinition.hierachyName == "foundation.triangle") && protectFoundations) || protectAllBuildingBlocks) info.damageTypes = new DamageTypeList(); if (info.damageTypes.Total() != 0f) return; var player = info.Initiator as BasePlayer; if (player && informPlayer && onlinePlayers[player].LastInformTime + informInterval < GetTimestamp()) { onlinePlayers[player].LastInformTime = GetTimestamp(); SendChatMessage(player, informMessage, (protectAllBuildingBlocks ? "buildings" : "foundations")); } }
Solved Editing a existing plugin
Discussion in 'Plugin Requests' started by dofof37, Jun 23, 2016.
-
Code:
if (block.LookupShortPrefabName().Contains("foundation")) info.damageTypes.ScaleAll(0.25f); // Scale damage with this. 1.0 is normal, 0.25 is 25% etc
-