From 7d036668798692cc02f116cd9e665aacdbef68ca Mon Sep 17 00:00:00 2001 From: MewMew Date: Tue, 2 Apr 2019 13:59:29 +0200 Subject: [PATCH] trust/untrust glitch fix --- chatbot.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/chatbot.lua b/chatbot.lua index 410ce949..976fcadb 100644 --- a/chatbot.lua +++ b/chatbot.lua @@ -33,8 +33,10 @@ local function process_custom_commands(event) if word == "trust" or word == "regular" then for word in string.gmatch(event.message, "%g+") do if game.players[word] then - global.trusted_players[word] = true - game.print(word .. " is now a trusted player.", {r=0.22, g=0.99, b=0.99}) + if game.players[word].name == word then + global.trusted_players[word] = true + game.print(word .. " is now a trusted player.", {r=0.22, g=0.99, b=0.99}) + end end end return @@ -42,8 +44,10 @@ local function process_custom_commands(event) if word == "untrust" then for word in string.gmatch(event.message, "%g+") do if game.players[word] then - global.trusted_players[word] = false - game.print(word .. " is no longer a trusted player.", {r=0.22, g=0.99, b=0.99}) + if game.players[word].name == word then + global.trusted_players[word] = false + game.print(word .. " is no longer a trusted player.", {r=0.22, g=0.99, b=0.99}) + end end end return