sounds
This commit is contained in:
12
sys/apis/sound.lua
Normal file
12
sys/apis/sound.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
local peripheral = _G.peripheral
|
||||
local speaker = peripheral.find('speaker')
|
||||
|
||||
local Sound = { }
|
||||
|
||||
function Sound.play(sound, vol)
|
||||
if speaker then
|
||||
speaker.playSound('minecraft:' .. sound, vol or 1)
|
||||
end
|
||||
end
|
||||
|
||||
return Sound
|
||||
Reference in New Issue
Block a user