#Equip items in inventory logs

1 messages · Page 1 of 1 (latest)

boreal gust
#

So is there a way to make a command where it logs when a player has used / equipped a tool?

rose torrent
jaunty coral
#

Heres a custom log script

return function(Vargs)
    local server, service = Vargs.Server, Vargs.Service

    local oldTabToType = server.Logs.TabToType
    server.Logs.CustomLogs, server.Logs.TabToType, server.Logs.ListUpdaters.CustomLogs = {}, function(tab: any, ...: any): string
        if tab == server.Logs.CustomLogs then
            return "CustomLogs"
        else
            return oldTabToType(tab, ...)
        end
    end, function(_)
        return server.Logs.CustomLogs
    end

    server.Commands.CustomLogs = {
        Prefix = server.Settings.Prefix;
        Commands = {"customlogs"};
        Args = {"autoupdate? (default: false)"};
        Description = "View the logs";
        AdminLevel = "Moderators";
        ListUpdater = "CustomLogs";
        Function = function(plr: Player, args: {string})
            server.Remote.MakeGui(plr, "List", {
                Title = "Custom Logs";
                Table =  server.Logs.ListUpdaters.CustomLogs(plr);
                Update = "CustomLogs";
                AutoUpdate = if args[1] and (string.lower(args[1]) == "true" or string.lower(args[1]) == "yes") then 1 else nil;
                Sanitize = true;
            })
        end
    }

    server.Admin.CacheCommands()

    --// Code goes here
end