summaryrefslogtreecommitdiff
path: root/gamemode/itemsystem
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/itemsystem')
-rw-r--r--gamemode/itemsystem/items/sprout.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/gamemode/itemsystem/items/sprout.lua b/gamemode/itemsystem/items/sprout.lua
index 9b8714b..3afb731 100644
--- a/gamemode/itemsystem/items/sprout.lua
+++ b/gamemode/itemsystem/items/sprout.lua
@@ -6,6 +6,16 @@ ITEM.Description = "Something you can craft with!"
ITEM.Icon = "test.png"
ITEM.UniqueData = false
+ITEM.GrowTime = 1
+ITEM.OnGrow = function(self, aor, owner)
+ local ent = ents.Create( "gms_tree" )
+ ent:SetPos( self:GetPos() )
+ ent:Spawn()
+ ent.GMSAutoSpawned = true
+ ent:SetNetworkedString( "Owner", "World" )
+end
+
+genericMakePlantable(ITEM)
genericMakeDroppable(ITEM)
GMS.RegisterResource(ITEM)