use HUD instead of sending a message

This commit is contained in:
olliy 2021-04-22 05:40:16 +05:00 committed by GitHub
parent 8667bb31c0
commit 2050ebc1d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,7 +82,11 @@ minetest.register_tool("shooter_rocket:rocket_gun_loaded", {
groups = {not_in_creative_inventory=1},
on_use = function(itemstack, user, pointed_thing)
if plcooldown[user:get_player_name()] ~= 0 then
minetest.chat_send_player(user:get_player_name(), "Your rocket has a cooldown!")
hud_event.new(user:get_player_name(), {
name = "shooter_rocket:cooldown",
color = "0xC1FF44",
value = "Your rocket has a cooldown!"
})
else
if not minetest.settings:get_bool("creative_mode") then
itemstack:add_wear(65535 / 50)