diff options
Diffstat (limited to 'gamemode/itemsystem/items/orangeseeds.lua')
| -rw-r--r-- | gamemode/itemsystem/items/orangeseeds.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gamemode/itemsystem/items/orangeseeds.lua b/gamemode/itemsystem/items/orangeseeds.lua index 01122c3..c9c3963 100644 --- a/gamemode/itemsystem/items/orangeseeds.lua +++ b/gamemode/itemsystem/items/orangeseeds.lua @@ -5,6 +5,27 @@ 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) + print("Owner:") + print(owner) + local plant = GAMEMODE.MakeGenericPlant( owner, self:GetPos() + Vector( 0, 0, -12 ), "models/props/cs_office/plant01_p1.mdl" ) + plant.Children = 0 + + plant:SetCollisionGroup( 0 ) + plant:SetSolid( SOLID_NONE ) + plant.Children = 0 + + local num = 1 + if ( IsValid( owner ) && owner:HasUnlock( "Adept_Farmer" ) ) then num = num + math.random( 0, 1 ) end + if ( IsValid( owner ) && owner:HasUnlock( "Expert_Farmer" ) ) then num = num + math.random( 0, 2 ) end + + for i = 1, num do + GAMEMODE.MakeGenericPlantChild( owner, self:GetPos() + Vector( math.random( -5, 5 ), math.random( -5, 5 ), math.random( 13, 30 ) ), "models/props/cs_italy/orange.mdl", plant ) + end +end + genericMakePlantable(ITEM) genericMakeDroppable(ITEM) |
