diff options
| author | Scott <scotth0828@gmail.com> | 2016-04-30 20:34:42 -0400 |
|---|---|---|
| committer | Scott <scotth0828@gmail.com> | 2016-04-30 20:34:42 -0400 |
| commit | bdf6cacc1fe7af364b93604253f3229d842d6170 (patch) | |
| tree | 21015081b4d66d45390ba625c09fb84d143f63db /gamemode/itemsystem/items/bananaseeds.lua | |
| parent | e8fc8b5bf824ed3283dede946e66f5fd843d54ff (diff) | |
| parent | c6b56a911622f9a52fd92293074192d1f13d3e96 (diff) | |
| download | gmstranded-bdf6cacc1fe7af364b93604253f3229d842d6170.tar.gz gmstranded-bdf6cacc1fe7af364b93604253f3229d842d6170.tar.bz2 gmstranded-bdf6cacc1fe7af364b93604253f3229d842d6170.zip | |
Merge branch 'master' of ssh://cogarr.net:43/home/git/gmsurvival
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) |
