Add piston sound

This commit is contained in:
oilboi 2020-03-24 00:55:04 -04:00
parent bc172356ba
commit 4bc23a3c12
4 changed files with 3 additions and 0 deletions

View File

@ -44,6 +44,7 @@ minetest.register_node("redstone:piston_off", {
local piston_location = vector.add(pos,dir)
local worked = piston_move(pos,dir)
if worked == true then
minetest.sound_play("piston", {pos=pos,pitch=math.random(85,100)/100})
minetest.set_node(piston_location,{name="redstone:actuator",param2=facedir})
minetest.set_node(pos,{name="redstone:piston_on",param2=facedir})
end
@ -82,6 +83,7 @@ minetest.register_node("redstone:piston_on", {
minetest.set_node(pos,{name="redstone:piston_off",param2=facedir})
piston_location.y = piston_location.y + 1
minetest.punch_node(piston_location)
minetest.sound_play("piston", {pos=pos,pitch=math.random(85,100)/100})
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local facedir = oldnode.param2

View File

@ -0,0 +1 @@
piston - https://freesound.org/people/sebastianlund/sounds/73531/

Binary file not shown.

Binary file not shown.