diff options
Diffstat (limited to 'gamemode')
| -rw-r--r-- | gamemode/itemsystem/items/platinumore.lua | 2 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/silverore.lua | 2 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/waterbottle.lua | 37 | ||||
| -rw-r--r-- | gamemode/processes.lua | 4 |
4 files changed, 41 insertions, 4 deletions
diff --git a/gamemode/itemsystem/items/platinumore.lua b/gamemode/itemsystem/items/platinumore.lua index b94d9eb..14b3f62 100644 --- a/gamemode/itemsystem/items/platinumore.lua +++ b/gamemode/itemsystem/items/platinumore.lua @@ -1,6 +1,6 @@ ITEM = {} -ITEM.Name = "Iron Ore" +ITEM.Name = "Platinum Ore" ITEM.Description = "Something you can craft with!" ITEM.Icon = "test.png" ITEM.UniqueData = false diff --git a/gamemode/itemsystem/items/silverore.lua b/gamemode/itemsystem/items/silverore.lua index b94d9eb..f0b0505 100644 --- a/gamemode/itemsystem/items/silverore.lua +++ b/gamemode/itemsystem/items/silverore.lua @@ -1,6 +1,6 @@ ITEM = {} -ITEM.Name = "Iron Ore" +ITEM.Name = "Silver Ore" ITEM.Description = "Something you can craft with!" ITEM.Icon = "test.png" ITEM.UniqueData = false diff --git a/gamemode/itemsystem/items/waterbottle.lua b/gamemode/itemsystem/items/waterbottle.lua new file mode 100644 index 0000000..df43749 --- /dev/null +++ b/gamemode/itemsystem/items/waterbottle.lua @@ -0,0 +1,37 @@ +ITEM = {} + +ITEM.Name = "Water Bottle" +ITEM.Description = "A delicious edible!" +ITEM.Icon = "test.png" +ITEM.UniqueData = false + +if(SERVER) then + util.AddNetworkString( "gms_drinkwaterbottle" ) +end + +local eat_client = function(ln, player) + net.Start("gms_drinkwaterbottle") + net.SendToServer() +end + +local finisheddrink = function() + player:DecResource( "Water Bottle", 1 ) + player:SendMessage( "You're a little less hungry and thirsty now.", 3, Color( 10, 200, 10, 255 ) ) + --Set thirst + player:SetThirst(math.Clamp(player.Thirst+100,0,1000)) +end + +local drink = function(ln, player) + if(player.Resources["Water Bottle"] <= 0) then + player:SendMessage( "You don't have enough to do that!", 3, Color( 10, 200, 10, 255 ) ) + return + end + startProcessGeneric(player,"Drinking some water",1,finisheddrink) +end +net.Receive( "gms_drinkwaterbottle", drink) + +ITEM.Actions = {} +genericMakeDroppable(ITEM) +ITEM.Actions["Drink Water"] = drink_client + +GMS.RegisterResource(ITEM) diff --git a/gamemode/processes.lua b/gamemode/processes.lua index 45e544d..58a2b48 100644 --- a/gamemode/processes.lua +++ b/gamemode/processes.lua @@ -844,11 +844,11 @@ end function PROCESS:OnStop() if (self.Owner:GetActiveWeapon():GetClass() == "gms_bucket") then - self.Owner:IncResource( "Water_Bottles", 10 ) + self.Owner:IncResource( "Water Bottles", 10 ) self.Owner:SendMessage( "Water Bottle ( 10x )", 3, Color( 10, 200, 10, 255 ) ) self.Owner:EmitSound( Sound( "ambient/water/water_spray" .. math.random( 1, 3 ) .. ".wav" ) ) else - self.Owner:IncResource( "Water_Bottles", 1 ) + self.Owner:IncResource( "Water Bottles", 1 ) self.Owner:SendMessage( "Water Bottle ( 1x )", 3, Color( 10, 200, 10, 255 ) ) self.Owner:EmitSound( Sound( "ambient/water/water_spray" .. math.random( 1, 3 ) .. ".wav" ) ) end |
