tnttag-cd2025/items.lua
debiankaios 8a24c8a3df New things:
- removed spaces which aren't needed
- removed settings.lua
- added changing of player count when player eliminated/quit
- Tnts are now really on head
2022-10-05 21:06:47 +02:00

33 lines
1.2 KiB
Lua

local S = minetest.get_translator("tnttag")
minetest.register_node("tnttag:tnt", {
description = "TNTTagger - Tag other players",
tiles = {"tnt_top.png", "tnt_side.png", "tnt_side.png"},
on_use = function(itemstack, user, pointed_thing)
user_name = user:get_player_name()
if arena_lib.is_player_in_arena(user_name, "tnttag") then
if pointed_thing.type == "object" then
if not pointed_thing.ref:get_luaentity() then
local player = pointed_thing.ref
local p_name = player:get_player_name()
if arena_lib.is_player_in_arena(p_name, "tnttag") then
local arena = arena_lib.get_arena_by_player(user_name)
if not arena.players[p_name].tagged then
tnttag.tagplayer(p_name, arena)
tnttag.untagplayer(user_name, arena)
-- Messages
for pl_name, _ in pairs(arena.players) do
minetest.chat_send_player(pl_name, user_name.." tagged "..p_name)
end
arena_lib.HUD_send_msg("title", p_name, "You have been tagged by "..user_name.."!",1, nil--[[sound?]], 0xFF3300)
arena_lib.HUD_send_msg("title", user_name, "You tagged "..p_name.."!",1, nil--[[sound?]], 0xFF3300)
end
end
end
end
end
end,
})
tnttag.tagitem = "tnttag:tnt"