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:
parent
1454f82e51
commit
24321fc605
14
init.lua
14
init.lua
|
@ -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
|
||||
|
||||
|
|
BIN
sounds/toolranks_levelup.ogg
Normal file
BIN
sounds/toolranks_levelup.ogg
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user