summaryrefslogtreecommitdiff
path: root/gamemode/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/init.lua')
-rw-r--r--gamemode/init.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/gamemode/init.lua b/gamemode/init.lua
index 468dba1..85d2a56 100644
--- a/gamemode/init.lua
+++ b/gamemode/init.lua
@@ -67,6 +67,13 @@ util.AddNetworkString('giveres')
net.Receive('removeEntity', function(len, ply)
local ent = net.ReadEntity()
+ if (ent:GetClass() == "gms_generic_plantable") then ply:SetNWInt( "plants", ply:GetNWInt( "plants" ) - 1 ) end
+ if ent.IsPlantChild then
+
+ local plant = ent.PlantParent
+ if (plant.Children <= 1) then plant:Fadeout() end
+
+ end
ent:Remove()
end)