summaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/items/bananaseeds.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/itemsystem/items/bananaseeds.lua')
-rw-r--r--gamemode/itemsystem/items/bananaseeds.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/gamemode/itemsystem/items/bananaseeds.lua b/gamemode/itemsystem/items/bananaseeds.lua
index 72e14b0..4a9d0c0 100644
--- a/gamemode/itemsystem/items/bananaseeds.lua
+++ b/gamemode/itemsystem/items/bananaseeds.lua
@@ -5,6 +5,21 @@ ITEM.Description = "Something you can plant!"
ITEM.Icon = "test.png"
ITEM.UniqueData = false
+
+--Things needed to make something plantable
+ITEM.GrowTime = 1
+ITEM.OnGrow = function(self, aor, owner)
+ local plant = GAMEMODE.MakeGenericPlant( owner, self:GetPos() + Vector( 0, 0, -3 ), "models/props/de_dust/du_palm_tree01_skybx.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( -7, 7 ), math.random( -7, 7 ), math.random( 48, 55 ) ), "models/props/cs_italy/bananna_bunch.mdl", plant )
+ end
+end
genericMakePlantable(ITEM)
genericMakeDroppable(ITEM)