-- Compiled with roblox-ts v1.2.7 local TS = _G[script] local OptionalValidator = TS.import(script, script.Parent, "OptionalValidator").OptionalValidator local StatefulZirconValidator = TS.import(script, script.Parent.Parent, "StatefulZirconValidator").StatefulZirconValidator local Players = game:GetService("Players") local ZirconServer = TS.import(script, script.Parent.Parent.Parent, "Server").default local ZirconFuzzyPlayersValidator do local super = StatefulZirconValidator ZirconFuzzyPlayersValidator = setmetatable({}, { __tostring = function() return "ZirconFuzzyPlayersValidator" end, __index = super, }) ZirconFuzzyPlayersValidator.__index = ZirconFuzzyPlayersValidator function ZirconFuzzyPlayersValidator.new(...) local self = setmetatable({}, ZirconFuzzyPlayersValidator) return self:constructor(...) or self end function ZirconFuzzyPlayersValidator:constructor() super.constructor(self, "Player[]") self.playerRef = {} end function ZirconFuzzyPlayersValidator:Validate(value, executingPlayer) self.playerRef = {} if type(value) == "string" then if (string.find(value, "^@", 1)) ~= nil then local id = string.sub(value, 2) if id == "me" and executingPlayer ~= nil then self.playerRef = { executingPlayer } return true end local _binding = ZirconServer.Registry.GetGroups({ id }) local group = _binding[1] if group ~= nil then for member in pairs(group:GetMembers()) do local _playerRef = self.playerRef -- ▼ Array.push ▼ _playerRef[#_playerRef + 1] = member -- ▲ Array.push ▲ end return true end end local _exp = Players:GetPlayers() local _arg0 = function(player) local _exp_1 = string.lower(player.Name) local _arg0_1 = string.lower(value) return (string.find(_exp_1, _arg0_1, 1, true)) ~= nil end -- ▼ ReadonlyArray.filter ▼ local _newValue = {} local _length = 0 for _k, _v in ipairs(_exp) do if _arg0(_v, _k - 1, _exp) == true then _length += 1 _newValue[_length] = _v end end -- ▲ ReadonlyArray.filter ▲ local matchingPlayers = _newValue for _, matchingPlayer in ipairs(matchingPlayers) do local _playerRef = self.playerRef -- ▼ Array.push ▼ _playerRef[#_playerRef + 1] = matchingPlayer -- ▲ Array.push ▲ end elseif type(value) == "number" then local userIdPlayer = Players:GetPlayerByUserId(value) if userIdPlayer then self.playerRef = { userIdPlayer } return true end end return #self.playerRef > 0 end function ZirconFuzzyPlayersValidator:Transform() local _playerRef = self.playerRef assert(_playerRef, "Transform called before Validate, perhaps?") return self.playerRef end end local ZirconFuzzyPlayers = ZirconFuzzyPlayersValidator.new() local OptionalZirconFuzzyPlayer = OptionalValidator.new(ZirconFuzzyPlayers) local _ = ZirconFuzzyPlayers return { ZirconFuzzyPlayersValidator = ZirconFuzzyPlayersValidator, ZirconFuzzyPlayers = ZirconFuzzyPlayers, OptionalZirconFuzzyPlayer = OptionalZirconFuzzyPlayer, }