From 59e4ebf708992b9b1da0967327d4c96fca24acd8 Mon Sep 17 00:00:00 2001 From: kacperks Date: Sun, 20 Nov 2022 23:28:08 +0100 Subject: [PATCH] Random Shit sounds added --- mods/poop/init.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mods/poop/init.lua b/mods/poop/init.lua index 8406fd1..d519828 100644 --- a/mods/poop/init.lua +++ b/mods/poop/init.lua @@ -1,3 +1,21 @@ +function sraj_dzwiek() + --make random sound + local sounds = { + "shitting1", + "shitting2", + "shitting3"} + local sound = sounds[math.random(1, #sounds)] + minetest.sound_play(sound, {pos = pos, gain = 2.0, max_hear_distance = 10}) + +end +function pakuj_guwno() + local sounds = { + "shit_packing1", + "shit_packing2", + "shit_packing3"} + local sound = sounds[math.random(1, #sounds)] + minetest.sound_play(sound, {pos = pos, gain = 2.0, max_hear_distance = 10}) +end minetest.register_node("poop:box", { description = "cardboard box", tiles = {"BOX.png"}, @@ -153,6 +171,7 @@ minetest.register_craftitem("poop:plumba", { "button_exit[0,1;2,2;exit;Exit]" minetest.show_formspec(user:get_player_name(), "poop:gui", formspec) pooped_things = pooped_things + 1 + pakuj_guwno() return itemstack else if node.name == "poop:Poop2" then minetest.remove_node(pointed_thing.under) @@ -163,6 +182,7 @@ minetest.register_craftitem("poop:plumba", { "button_exit[0,1;2,2;exit;Exit]" minetest.show_formspec(user:get_player_name(), "poop:gui", formspec) pooped_things = pooped_things + 1 + pakuj_guwno() return itemstack end @@ -196,6 +216,7 @@ minetest.register_craftitem("poop:pooper", { minetest.add_node(pointed_thing.under, {name="poop:Poop2"}) end end + sraj_dzwiek() return itemstack end, })