diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-21 15:04:13 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-21 15:04:13 -0400 |
| commit | c59d7bdbc84f11539fa0b00b492dccf907cf8cf7 (patch) | |
| tree | 44b0cbe12345f513e4bc9b8cb3cf461aec2ab618 /gamemode/itemsystem/common_plantable.lua | |
| parent | c2358c4659b5adc200a8bcd37d36b0160cc3a856 (diff) | |
| download | gmstranded-c59d7bdbc84f11539fa0b00b492dccf907cf8cf7.tar.gz gmstranded-c59d7bdbc84f11539fa0b00b492dccf907cf8cf7.tar.bz2 gmstranded-c59d7bdbc84f11539fa0b00b492dccf907cf8cf7.zip | |
Finished adding plant limits
Diffstat (limited to 'gamemode/itemsystem/common_plantable.lua')
| -rw-r--r-- | gamemode/itemsystem/common_plantable.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gamemode/itemsystem/common_plantable.lua b/gamemode/itemsystem/common_plantable.lua index 4db5618..b0ef3dc 100644 --- a/gamemode/itemsystem/common_plantable.lua +++ b/gamemode/itemsystem/common_plantable.lua @@ -29,16 +29,18 @@ local function plant(player, resourcename) return end + //Everything is good, make the plant + ply:SetNWInt( "plants", ply:GetNWInt( "plants" ) + 1 ) local pent = ents.Create("gms_generic_plantable") pent:SetPos(tr.HitPos) pent.GrowTime = tbl.GrowTime pent.OnGrow = tbl.OnGrow pent:SetOwner(player) pent:Spawn() - player.NumPlants += 1 player:DecResource( resourcename, 1 ) end end + net.Receive( "gms_plantseed", function(len,pl) local resourcename = net.ReadString() plant(pl,resourcename) |
