summaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/items/melonseeds.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/itemsystem/items/melonseeds.lua')
-rw-r--r--gamemode/itemsystem/items/melonseeds.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/gamemode/itemsystem/items/melonseeds.lua b/gamemode/itemsystem/items/melonseeds.lua
index 8ddaea5..8d82f7a 100644
--- a/gamemode/itemsystem/items/melonseeds.lua
+++ b/gamemode/itemsystem/items/melonseeds.lua
@@ -5,6 +5,19 @@ ITEM.Description = "Something you can plant!"
ITEM.Icon = "test.png"
ITEM.UniqueData = false
+ITEM.GrowTime = 1
+ITEM.OnGrow = function(self, aor, owner)
+ local plant = GAMEMODE.MakeGenericPlant( owner, self:GetPos() + Vector( 0, 0, 13 ), "models/props/CS_militia/fern01.mdl" )
+ plant.Children = 0
+
+ local num = 1
+ if ( IsValid( ply ) && ply:HasUnlock( "Adept_Farmer" ) ) then num = num + math.random( 0, 1 ) end
+ if ( IsValid( ply ) && ply:HasUnlock( "Expert_Farmer" ) ) then num = num + math.random( 0, 2 ) end
+
+ for i = 1, num do
+ GAMEMODE.MakeGenericPlantChild( owner, self:GetPos() + Vector( math.random( -25, 25 ), math.random( -25, 25 ), math.random( 5, 7 ) ), "models/props_junk/watermelon01.mdl", plant )
+ end
+end
genericMakeDroppable(ITEM)
genericMakePlantable(ITEM)