From 2cdcadf6d1a2e981cb4127fd2e3b2a7549593238 Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Sun, 3 Dec 2023 15:15:07 -0500 Subject: [PATCH] send test data per player as to not be spam nightmare when testing with multiple players --- test.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test.lua b/test.lua index 9f74784..3bb2e67 100644 --- a/test.lua +++ b/test.lua @@ -1,13 +1,16 @@ controls.register_on_press(function(player, key) - minetest.chat_send_all(player:get_player_name() .. " pressed " .. key) + local pname = player:get_player_name() + minetest.chat_send_player(pname, pname .. " pressed " .. key) end) controls.register_on_hold(function(player, key, length) - minetest.chat_send_all(player:get_player_name() .. " held " .. key .. " for " .. length .. " seconds") + local pname = player:get_player_name() + minetest.chat_send_player(pname, pname .. " held " .. key .. " for " .. length .. " seconds") end) controls.register_on_release(function(player, key, length) - minetest.chat_send_all(player:get_player_name() .. " released " .. key .. " after " .. length .. " seconds") + local pname = player:get_player_name() + minetest.chat_send_player(pname, pname .. " released " .. key .. " after " .. length .. " seconds") end) minetest.register_on_joinplayer(function(player, _)