mirror of
https://github.com/lisacvuk/minetest-toolranks.git
synced 2025-01-08 15:10:16 +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
|
dugnodes = dugnodes + 1
|
||||||
end
|
end
|
||||||
if(itemstack:get_wear() > 60135) then
|
if(itemstack:get_wear() > 60135) then
|
||||||
minetest.chat_send_player(user:get_player_name(), "Your tool is about to break, comrade!")
|
minetest.chat_send_player(user:get_player_name(), "Your tool is about to break, comrade!")
|
||||||
minetest.sound_play("default_tool_breaks", {
|
minetest.sound_play("default_tool_breaks", {
|
||||||
to_player = user:get_player_name(),
|
to_player = user:get_player_name(),
|
||||||
gain = 2.0,
|
gain = 2.0,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
level = toolranks.get_level(dugnodes)
|
level = toolranks.get_level(dugnodes)
|
||||||
|
|
||||||
@ -72,6 +72,10 @@ function toolranks.new_afteruse(itemstack, user, node, digparams)
|
|||||||
local levelup_text = "Your " .. toolranks.colors.green ..
|
local levelup_text = "Your " .. toolranks.colors.green ..
|
||||||
itemdesc .. toolranks.colors.white ..
|
itemdesc .. toolranks.colors.white ..
|
||||||
" just leveled up!"
|
" 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)
|
minetest.chat_send_player(user:get_player_name(), levelup_text)
|
||||||
end
|
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