diff options
Diffstat (limited to 'gamemode/itemsystem/items/bananaseeds.lua')
| -rw-r--r-- | gamemode/itemsystem/items/bananaseeds.lua | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/gamemode/itemsystem/items/bananaseeds.lua b/gamemode/itemsystem/items/bananaseeds.lua index 358ed63..4a9d0c0 100644 --- a/gamemode/itemsystem/items/bananaseeds.lua +++ b/gamemode/itemsystem/items/bananaseeds.lua @@ -5,22 +5,22 @@ ITEM.Description = "Something you can plant!" ITEM.Icon = "test.png" ITEM.UniqueData = false -local drop1 = function(player) - print("Drop 1 called") -end -local dropall = function(player) - print("Drop all called") -end +--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 dropx = function(player) - print("Drop x called") -end + 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 -ITEM.Actions = {} -ITEM.Actions["Drop"] = {} -ITEM.Actions["Drop"]["Drop 1"] = drop1 -ITEM.Actions["Drop"]["Drop all"] = dropall -ITEM.Actions["Drop"]["Drop X"] = dropx + 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) GMS.RegisterResource(ITEM) |
