From 4bc1bfee8b674eadf7fa261f8b9d33bc5a619737 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Sat, 1 May 2021 02:23:56 +0200 Subject: [PATCH] Small fix --- init.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 8a02858..b2dec73 100644 --- a/init.lua +++ b/init.lua @@ -2780,12 +2780,15 @@ if rawget(_G, "awards") then end core.register_on_chatcommand(function(name, command, params) - if find(command, "grant") or find(command, "revoke") then + if sub(command, 1, 5) == "grant" or sub(command, 1, 6) == "revoke" then params = split(params, " ") - if params[2] and find(params[2], "creative") then - local data = pdata[name] - reset_data(data) + for _, v in ipairs(params) do + if find(v, "creative") then + local data = pdata[name] + reset_data(data) + break + end end end