1
0
mirror of https://github.com/lisacvuk/minetest-toolranks.git synced 2024-11-14 05:50:22 +01:00

-Add a sound when tool levels up

-Fix tabs instead of spaces
This commit is contained in:
Stefan Vukanović 2017-07-27 15:21:03 +02:00
parent 1454f82e51
commit 24321fc605
2 changed files with 9 additions and 5 deletions

View File

@ -60,11 +60,11 @@ function toolranks.new_afteruse(itemstack, user, node, digparams)
dugnodes = dugnodes + 1
end
if(itemstack:get_wear() > 60135) then
minetest.chat_send_player(user:get_player_name(), "Your tool is about to break, comrade!")
minetest.sound_play("default_tool_breaks", {
to_player = user:get_player_name(),
gain = 2.0,
})
minetest.chat_send_player(user:get_player_name(), "Your tool is about to break, comrade!")
minetest.sound_play("default_tool_breaks", {
to_player = user:get_player_name(),
gain = 2.0,
})
end
level = toolranks.get_level(dugnodes)
@ -72,6 +72,10 @@ function toolranks.new_afteruse(itemstack, user, node, digparams)
local levelup_text = "Your " .. toolranks.colors.green ..
itemdesc .. toolranks.colors.white ..
" just leveled up!"
minetest.sound_play("toolranks_levelup", {
to_player = user:get_player_name(),
gain = 2.0,
})
minetest.chat_send_player(user:get_player_name(), levelup_text)
end

Binary file not shown.